How to listen for multiple tcp connection using nc

Aman Jain picture Aman Jain · Apr 19, 2015 · Viewed 32.4k times · Source

How to create a TCP connection using nc which listens to multiple hosts?

nc -l -p 12345

Answer

Hans Z. picture Hans Z. · Apr 21, 2015

Simultaneous connections are not possible with netcat. You should use something like ucspi-tcp's tcpserver tool or leverage xinetd since you're on Linux.

See: https://superuser.com/questions/232747/netcat-as-a-multithread-server

Consecutive connections could be handled through a shell script that restarts netcat after it finishes.