Scenario
Whenever the netcat server receives a connection, I want it to sleep for 2s before returning a HTTP response.
I know we can turn netcat into a simple HTTP server by something like nc -lp 3000 < httprespose.
Question
How do I simulate the 2s delay?
socatandnetcatare different tools. – Kamil Maciorowski Apr 09 '20 at 05:46netcatsince it's so versatile and recommended by many people. Are there anythingnetcatcan do butsocatcan't in your opinion? – Tran Triet Apr 09 '20 at 05:49netcatcannot do butsocatcan. I suspect all thingsnetcatcan do,socatcan do as well. Note there are at least two major implementations ofnetcat(akanc). There is alsoncat. See this. – Kamil Maciorowski Apr 09 '20 at 05:55different flavors of netcatbut I guess they probably provide similar functionalities. Could you cook up a solution for my problem withsocatand put in the answer? That'd really help me and I'll be very happy to accept it right away. – Tran Triet Apr 09 '20 at 06:03