Skip to content

Instantly share code, notes, and snippets.

@matejb
Created August 18, 2013 21:14
Show Gist options
  • Save matejb/6264049 to your computer and use it in GitHub Desktop.
Save matejb/6264049 to your computer and use it in GitHub Desktop.
one line web server in bash
Author: http://www.razvantudorica.com/08/web-server-in-one-line-of-bash/
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html; } | nc -l 8080; done
index.html can be any file you want to serve it.
You can access it after that as: http://host_ip:8080/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment