if local-address is present, bind to that ip instead of 0.0.0.0

This commit is contained in:
Herve Couplet committed 2018-01-23 17:53:40 +01:00
1 parent 4a380ad7fc
commit 9134b6ea98
1 file changed
+8 -2
+8 -2
View File
@@ -1984,9 +1984,15 @@ _startserver() {
_NC="$_NC -6"
fi
SOCAT_OPTIONS=TCP-LISTEN:$Le_HTTPPort,crlf,reuseaddr,fork
#Adding bind to local-address
if [ "$_local_address" ]; then
$SOCAT_OPTIONS="$SOCAT_OPTIONS,bind=${_local_address}"
fi
_debug "_NC" "$_NC"
#todo listen address
$_NC TCP-LISTEN:$Le_HTTPPort,crlf,reuseaddr,fork SYSTEM:"sleep 0.5; echo HTTP/1.1 200 OK; echo ; echo $content; echo;" &
$_NC $SOCAT_OPTIONS SYSTEM:"sleep 0.5; echo HTTP/1.1 200 OK; echo ; echo $content; echo;" &
serverproc="$!"
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.