Created
October 14, 2014 16:31
-
-
Save p120ph37/49bf890ee37087d37114 to your computer and use it in GitHub Desktop.
Minimal webserver in Perl.
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
socket$s,2,1,6;bind$s,pack+snN3,2,8080;listen$s,1;while(accept$c,$s){<$c>=~/\/(\S+)/;open$f,$1;print$c(<$f>);close$c} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run using
perl -e'...'
Don't expect it to be efficient or secure - for example directory traversal is allowed...