diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-27 16:11:55 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-27 16:11:55 -0700 |
commit | 31f7b2a5a65d2d640343013dac4bb836c3bfba5f (patch) | |
tree | e677a00733440e57ab61fb00a696284c1d7b960b /third_party/websockify/rebind | |
parent | e546b42883bbcabb4657dfcdb523a93d0458f5b3 (diff) |
initial (not-yet-working) sockets implementation
Diffstat (limited to 'third_party/websockify/rebind')
-rwxr-xr-x | third_party/websockify/rebind | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/third_party/websockify/rebind b/third_party/websockify/rebind new file mode 100755 index 00000000..2289aaa4 --- /dev/null +++ b/third_party/websockify/rebind @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +usage() { + echo "Usage: $(basename $0) OLD_PORT NEW_PORT COMMAND_LINE" + echo + echo "Launch COMMAND_LINE, but intercept system calls to bind" + echo "to OLD_PORT and instead bind them to localhost:NEW_PORT" + exit 2 +} + +# Parameter defaults +mydir=$(readlink -f $(dirname ${0})) + +export REBIND_PORT_OLD="${1}"; shift +export REBIND_PORT_NEW="${1}"; shift + +LD_PRELOAD=${mydir}/rebind.so "${@}" + |