Last active
December 8, 2016 11:26
-
-
Save indisoluble/3c051ffa5a7443bc827cad5d542b4ebb to your computer and use it in GitHub Desktop.
Netcat Web Server: Listen connections on specified port, print requests & response with a 200 OK
This file contains hidden or 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
#!/bin/bash | |
echo "Listening port: $1" | |
while true; | |
do echo "=====>"; | |
echo -e 'HTTP/1.1 200 OK\r\n' | sudo nc -l $1; | |
echo ""; | |
echo "<====="; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment