Created
April 25, 2018 22:53
-
-
Save colejhudson/c5c8dd289431ad8ed5621ed678ff3d91 to your computer and use it in GitHub Desktop.
Simple Protocol Independent Reverse Proxy
This file contains hidden or 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
| #!/usr/bin/env bash | |
| function proxy() { | |
| local PUBLIC_PORT="80" | |
| local LOCAL_HOST="127.0.0.1" | |
| local LOCAL_PORT="8080" | |
| mkfifo socket | |
| sudo nc -kl ${1=PUBLIC_PORT} 0<socket | nc ${2=LOCAL_HOST} ${3=LOCAL_PORT} 1>socket | |
| rm socket | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment