Adds NGROK_PORT as per issue #3.
This commit is contained in:
parent
955515af69
commit
4f5fdae585
|
@ -74,6 +74,7 @@ Additionally, you can specify one of several environment variable (via `-e`) to
|
||||||
* `NGROK_USERNAME` - Username to use for HTTP authentication on the tunnel. You must also specify an authentication token.
|
* `NGROK_USERNAME` - Username to use for HTTP authentication on the tunnel. You must also specify an authentication token.
|
||||||
* `NGROK_PASSWORD` - Password to use for HTTP authentication on the tunnel. You must also specify an authentication token.
|
* `NGROK_PASSWORD` - Password to use for HTTP authentication on the tunnel. You must also specify an authentication token.
|
||||||
* `NGROK_PROTOCOL` - Can either be `HTTP` or `TCP`, and it defaults to `HTTP` if not specified. If set to `TCP`, Ngrok will allocate a port instead of a subdomain and proxy TCP requests directly to your application.
|
* `NGROK_PROTOCOL` - Can either be `HTTP` or `TCP`, and it defaults to `HTTP` if not specified. If set to `TCP`, Ngrok will allocate a port instead of a subdomain and proxy TCP requests directly to your application.
|
||||||
|
* `NGROK_PORT` - Port to expose (defaults to `80` for `HTTP` protocol).
|
||||||
|
|
||||||
|
|
||||||
## Feedbacks
|
## Feedbacks
|
||||||
|
|
|
@ -4,6 +4,17 @@ if [ -n "$@" ]; then
|
||||||
exec "$@"
|
exec "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Legacy compatible:
|
||||||
|
if [ -z "$NGROK_PORT" ]; then
|
||||||
|
if [ -n "$HTTPS_PORT" ]; then
|
||||||
|
NGROK_PORT="$HTTPS_PORT"
|
||||||
|
elif [ -n "$HTTPS_PORT" ]; then
|
||||||
|
NGROK_PORT="$HTTP_PORT"
|
||||||
|
elif [ -n "$APP_PORT" ]; then
|
||||||
|
NGROK_PORT="$APP_PORT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
ARGS="ngrok"
|
ARGS="ngrok"
|
||||||
|
|
||||||
|
@ -12,6 +23,7 @@ if [ "$NGROK_PROTOCOL" = "TCP" ]; then
|
||||||
ARGS="$ARGS tcp"
|
ARGS="$ARGS tcp"
|
||||||
else
|
else
|
||||||
ARGS="$ARGS http"
|
ARGS="$ARGS http"
|
||||||
|
NGROK_PORT="${NGROK_PORT:-80}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the authorization token.
|
# Set the authorization token.
|
||||||
|
@ -47,14 +59,12 @@ fi
|
||||||
|
|
||||||
ARGS="$ARGS -log stdout"
|
ARGS="$ARGS -log stdout"
|
||||||
|
|
||||||
# Set the point.
|
# Set the port.
|
||||||
if [ -n "$HTTPS_PORT" ]; then
|
if [ -z "$NGROK_PORT" ]; then
|
||||||
ARGS="$ARGS `echo $HTTPS_PORT | sed 's|^tcp://||'`"
|
echo "You must specify a NGROK_PORT to expose."
|
||||||
elif [ -n "$HTTP_PORT" ]; then
|
exit 1
|
||||||
ARGS="$ARGS `echo $HTTP_PORT | sed 's|^tcp://||'`"
|
|
||||||
elif [ -n "$APP_PORT" ]; then
|
|
||||||
ARGS="$ARGS `echo $APP_PORT | sed 's|^tcp://||'`"
|
|
||||||
fi
|
fi
|
||||||
|
ARGS="$ARGS `echo $NGROK_PORT | sed 's|^tcp://||'`"
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
exec $ARGS
|
exec $ARGS
|
||||||
|
|
Loading…
Reference in New Issue