home / blog

Simulating a server with netcat

Note use of \r\n. and echo -n, i.e. no automatic new line and -e escape chars

echo -ne "HTTP/1.1 200 OK\r\nContent-Encoding: gzip$(echo hello-world | gzip)\n" | netcat -l 4000
This entry was posted in geek. Bookmark the permalink.

Leave a Reply

Your email address will not be published.