mercredi 26 juillet 2017
Playing with ncat and Python http.server
Par Nicolas, mercredi 26 juillet 2017 à 15:41 :: geek stuff
- open a webserver and browse
python3 -m http.server 8080
- open a listening socket on port 9000
ncat -l 9000
- upon browser call at localhost:9000 - see the HTTP GET request come in and answer it as follows :
HTTP/1.1 307 Temporary Redirect Location: https://www.eff.org/
HTTP/1.1 200 OK Content-length: 10 Content-type: text/plain
1234567890
- see 1234567890 print in the browser