Last active
December 10, 2016 15:18
-
-
Save nicolanrizzo/055fcfb2ef3003c2ea6b0135c3608427 to your computer and use it in GitHub Desktop.
Setting up a one-shot webserver on port 8080 to present the content of a file. Source: https://en.wikipedia.org/wiki/Netcat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <index.html)\r\n\r\n"; cat index.html; } | nc -l 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment