-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netcat #26
Comments
What annoys me the most is that netcat implementations only handle one connection at time. GNU nc have some advanced support for multiple connections but as far as I remember it sucks... What about: # listen to tcp port 8080 and send 'response.dump' to first client connection
$ cat response.dump | nc -stats -l tcp://:8080
Remote client: 192.168.10.56:48500
Bytes sent: 486
TCP Connection: 30ms
Content transfer: 2ms
Done
$
# -repeat handle multiple connections
$ cat response.dump | nc -stats -repeat -listen tcp://:8080
Press CTRL-D to abort...
Remote client: 192.168.10.56:48500
Bytes sent: 486
TCP Connection: 30ms
Content transfer: 2ms
Done
Remote client: 192.168.10.56:42196
Bytes sent: 486
TCP Connection: 30ms
Content transfer: 2ms
Done
^D
$ |
Another idea, maybe it sucks but who knows... is add support for HTTP protocol out of the box... it's everywhere and rule the IT world... Something like below could be interesting: $ cat input.json | nc http://www.jsonlint.com/indent
{
"data": "test",
"data2": "test2"
}
$ And, the most nice: # serve index.html to every HTTP connection on port 8080
$ cat index.html | nc -repeat -listen http://0.0.0.0:8080
Press CTRL-D to abort...
^D
# Serve the input files in HTTP port 8080
$ ls | nc -repeat -serve -listen http://0.0.0.0:8080
# or a directory tree
$ find . | nc -repeat -serve -listen http://0.0.0.0:8080
# Instead of serve a directory, serving specific input files avoid path traversal attacks. Maybe it's too much... I don't know. |
@tiago4orion the http thing I'm also thinking it may be too much, I need time to let the idea grow :-). About the -repeat option, sounds interesting, but what would be the semantics ? I send the stdin and close the connection or a wait for the other side to close it ? It seems like you are modeling a request/response thing, but nc would be more general than this no ? |
Lets develop an nc. Should work with:
So we can hack the shit out of stuff :-)
The text was updated successfully, but these errors were encountered: