3

What is the simplest way to do the following thing?

Run a program which will open specified port, listen for it, and display whatever it receives. Also if type something -- then send back to connected peer.

This is for debug purposes.

8

Server listens on port 8000:

$ nc -l 8000

Client connects to port 8000:

$ nc localhost 8000 
  • This doesn't answer the question. The poster wanted to display what the client sends. The only way I see is to use the "-c" or "-e" option but I'm hoping there's a solution using only pipes. – Sridhar Sarnobat Aug 2 '14 at 3:23
1

This sounds like a job for Gnu Netcat (nc)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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