Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created July 3, 2025 00:51
Show Gist options
  • Save noslin005/ddc4ceceab8d981a3716f7fbb970910c to your computer and use it in GitHub Desktop.
Save noslin005/ddc4ceceab8d981a3716f7fbb970910c to your computer and use it in GitHub Desktop.

Socat

Receiver

socat -d -d UDP-RECV:9000,ip-add-membership=239.0.0.1:0.0.0.0,interface=eth0,reuseaddr FILE:/dev/ttyS1,raw,echo=0
socat -d -d UDP-RECV:9000,ip-add-membership=239.0.0.1:0.0.0.0,interface=eth0,reuseaddr PTY,raw,echo=0,link=/tmp/virtual-tty
socat -d -d UDP-RECV:9000,ip-add-membership=239.0.0.1:0.0.0.0,reuseaddr SYSTEM:'tee /dev/ttyS1 > /tmp/mirror'

Sender

socat -d -d PTY,raw,echo=0,link=/dev/ttyS1 UDP-DATAGRAM:239.0.0.1:9000,interface=eth0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment