Skip to content

Instantly share code, notes, and snippets.

@indisoluble
Last active December 8, 2016 11:26
Show Gist options
  • Save indisoluble/3c051ffa5a7443bc827cad5d542b4ebb to your computer and use it in GitHub Desktop.
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
#!/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