Forked from ljjjustin/socat-tcp-to-unix-socket.sh
Created
September 29, 2021 01:03
-
-
Save blisabda/f25e1bc777e24ba6bc5d379a0516d9b9 to your computer and use it in GitHub Desktop.
socat-unix-socket-to-tcp.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 3 ]; then | |
echo "usage: $0 <unix socket file> <host> <listen port>" | |
exit | |
fi | |
SOCK=$1 | |
HOST=$2 | |
PORT=$3 | |
socat -d -d -d -lf socat.log UNIX-LISTEN:${SOCK},reuseaddr,fork TCP:${HOST}:${PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "usage: $0 <listen port> <unix socket file>" | |
exit | |
fi | |
PORT=$1 | |
SOCK=$2 | |
socat -d -d -d -lf ns-socat.log TCP-LISTEN:${PORT},reuseaddr,fork UNIX-CLIENT:${SOCK} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment