Chi's Journal
- Ecclesiastes 1.11
socat

snippets:

  • simple udp echo server: echo payload with client ip:port

    socat -d -d udp-recvfrom:1926,fork system:"echo \"\$SOCAT_PEERADDR:\$SOCAT_PEERPORT\"; cat"
    
    client > echo "0817" | socat - udp-sendto:server-ip:1926
  • simple tcp echo server: echo payload with client ip:port

    socat -d -d tcp-l:1926,fork system:"echo \"\$SOCAT_PEERADDR:\$SOCAT_PEERPORT\"; cat"
    client > echo "0817" | socat  tcp:server-ip:1926 -

Last modified on 2020-05-17

Comments powered by Disqus