Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtojek/go-telnet
Read bytes from stdin and pass them to the remote host
https://github.com/mtojek/go-telnet
Last synced: 3 months ago
JSON representation
Read bytes from stdin and pass them to the remote host
- Host: GitHub
- URL: https://github.com/mtojek/go-telnet
- Owner: mtojek
- License: apache-2.0
- Created: 2015-10-11T13:00:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-12T19:58:46.000Z (about 9 years ago)
- Last Synced: 2024-10-10T16:30:58.105Z (3 months ago)
- Language: Go
- Size: 156 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-telnet
[![Build Status](https://travis-ci.org/mtojek/go-telnet.svg?branch=master)](https://travis-ci.org/mtojek/go-telnet)
Status: **Done**
Read bytes from stdin and pass them to the remote host. The application works similarly to the well known telnet application, but it lets you read bytes from standard input and wait for response.
### Problem Definition
Old telnet does not work in that manner and it requires a script based on _expect_ command. Trying an intuitive solution would end up with that:
~~~
$ cat resources/input-data/wp.pl_1.bin | telnet wp.pl 80
Trying 212.77.100.101...
Connected to www.wp.pl.
Escape character is '^]'.
Connection closed by foreign host.
~~~The same execution of _go-telnet_ ends with a received server response:
~~~
$ cat resources/input-data/wp.pl_1.bin | go-telnet wp.pl 80
HTTP/1.1 200 OK
Server: aris
Expires: Sun, 11 Oct 2015 20:34:22 GMT
Last-Modified: Sun, 11 Oct 2015 20:34:22 GMT
Pragma: no-cache
Cache-Control: no-cache
Content-type: text/html; charset=UTF-8
Set-Cookie: ...
~~~### Usage ###
~~~
$ go-telnet --help
usage: go-telnet []Read bytes from stdin and pass them to the remote host.
Flags:
--help Show help (also see --help-long and --help-man).
-t, --timeout=1s Byte receiving timeout after the input EOF occurs
--version Show application version.Args:
Target host
Target port
~~~