Skip to content

Instantly share code, notes, and snippets.

@nfrigus
Forked from talwai/servefile.sh
Created June 2, 2022 23:48
Show Gist options
  • Save nfrigus/45cdda96a7bfdf0fde64f75670c77ced to your computer and use it in GitHub Desktop.
Save nfrigus/45cdda96a7bfdf0fde64f75670c77ced to your computer and use it in GitHub Desktop.
One-shot HTTP webserver to serve file contents using netcat
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment