0
I am trying to debug a network client. I just need to see several HTTP requests made in sequence.
my first idea was o run nc -l 80
, but it will keep open the socket after the first connection. Is there a way to run it quickly as a deamon or multithreaded mode? without having to setup inetd or the likes?
my inelegant solution so far is:
while true; do echo 123 | sudo nc -l 80; done
it works but is a pain to kill :)
Also you can see there that i do not care at all what is replied to the client. I just want to see the requests coming in without having to install apache/ngix/any more complex script than nc
Why not use a packet sniffer like Wireshark? – Daniel B – 2016-02-29T20:26:03.233
mostly because every host nowadays have
nc
by default. So i want to learn something that i can use anytime without any overhead. – gcb – 2016-02-29T21:31:43.753