Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, 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]]
share|improve this question
up vote 1 down vote accepted

Take a close look at the help output netcat is giving you

usage: ... [-p source_port] ...
       ... [hostname] [port[s]]

The -p option to netcat species the source port, which you generally don't care about. If you remove the -p, it should work just fine:

nc -l 80

At least, this will make netcat listen for connections on port 80. Whether this will make your logging proxy work or not I can't say.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.