Date created: 03/17/20 14:54:25. Last modified: 03/17/20 14:55:49

HTTP Servers

Bash:

#!/usr/bin/env bash
RESPONSE="HTTP/1.1 200 OK\r\nConnection: keep-alive\r\n\r\n${2:-"OK"}\r\n"
while { echo -en "$RESPONSE"; } | nc -l "${1:-8080}"; do
echo "================================================"
done

 

Python 3:

python -m http.server
python -m http.server 8080
python -m http.server 8080 --bind 192.168.0.123

 

Python 2:

python -m SimpleHTTPServer

 


Previous page: 'dig' - Notes
Next page: 'iperf' Notes