I have a web server listening at 8080, I want to use the nc command to listen at port 80, so all incoming request and outgoing response are logged into two files, namely inflow and outflow.
I have followed the link at http://smaftoul.wordpress.com/2009/05/13/netcat-as-a-logging-tcp-proxy/, not work as expected.
cat proxypipe | nc -l -p 80 | tee -a inflow | nc localhost 81 | tee -a outflow 1>proxypipe
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port]
[-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]
[-x proxy_address[:port]] [hostname] [port[s]]