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?
socat
andnetcat
are different tools. – Kamil Maciorowski Apr 09 '20 at 05:46netcat
since it's so versatile and recommended by many people. Are there anythingnetcat
can do butsocat
can't in your opinion? – Tran Triet Apr 09 '20 at 05:49netcat
cannot do butsocat
can. I suspect all thingsnetcat
can do,socat
can 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 netcat
but I guess they probably provide similar functionalities. Could you cook up a solution for my problem withsocat
and 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