I am trying to set up a reverse Telnet (Telnet to COM) on Mac OS X 10.9.5 (Mavericks). The Mac is connected to a serial device. I have no problem accessing the serial device from the Mac using screen:
However, I would like to access the device remotely, via Telnet.
I tried using Netcat (
nc) and have limited success. The command I used is:
nc -l 9999 > /dev/cu.USBserial < /dev/cu.USBserial
And then I can Telnet to the device. However, it does not work for two reasons:
- For interactive user interface, the input is essentially line buffered until I hit return.
- All my input is echoed back to me. In real life, the device should the one echoing my input characters.
What is the right way of doing it?