How can I one-to-many stream with netcat or socat?

56 Views Asked by At

I have a serial device I would like to share with other devices on my network. I would like each device to be able to read/write to this serial device.

I have used netcat to stream this serial device but noticed that when one IP connects no one else can. Is there a way to multicast a serial stream AND be able to write to the serial device? Thanks

Also, I know that this is insecure since the communication is plaintext and no authentication is done but that is not relevant for my use case.

1

There are 1 best solutions below

0
dest-unreach On

The latest Socat release contains a shell script that should do the trick with something like:

socat-mux.sh TCP-L:1234,reuseaddr,fork /dev/serial