wswrapper.so will only interpose on the listen port specified in WSWRAP_PORT. Add simple wswrap script that sets the WSWRAP_PORT, LD_PRELOAD and invokes the command line to wrap.
23 lines
400 B
Bash
Executable File
23 lines
400 B
Bash
Executable File
#!/bin/bash
|
|
|
|
usage() {
|
|
echo "Usage: $(basename $0) PORT CMDLINE"
|
|
echo
|
|
echo " PORT Port to wrap with WebSockets support"
|
|
echo " CMDLINE Command line to wrap"
|
|
exit 2
|
|
}
|
|
|
|
# Parameter defaults
|
|
mydir=$(dirname ${0})
|
|
|
|
# Process parameters
|
|
#while [ "${1}" != "${1#-}" ]; do
|
|
# param=$1; shift
|
|
#done
|
|
|
|
export WSWRAP_PORT="${1}"; shift
|
|
|
|
LD_PRELOAD=${mydir}/wswrapper.so "${@}"
|
|
|