Created
April 5, 2018 17:49
-
-
Save toriaezunama/5eeb598ddd6c0ca6ee31e6765084ac14 to your computer and use it in GitHub Desktop.
Use netcat to proxy requests
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 | |
# From: https://notes.tweakblogs.net/blog/7955/using-netcat-to-build-a-simple-tcp-proxy-in-linux.html | |
LOCAL_PORT=$1 | |
REMOTE_HOST=$2 | |
REMOTE_PORT=$3 | |
mkfifo fifo | |
nc -k -l -p $LOCAL_PORT <fifo | nc $REMOTE_HOST $REMOTE_PORT >fifo | |
rm fifo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment