I'd like to take a program P that reads from stdinstdin & writes to stdout andstdout, but connect it to ncnc or whatever such that it reads from a certain port and outputs to another port.
# The reading is easy, here P reads from port 50505
nc -l 50505 | P
How do I get it to write back to say port 60606?