Add $NGROK_LOOK_DOMAIN

This commit is contained in:
zabio3 2019-04-02 20:19:37 +09:00 committed by Werner Beroux
parent 202c4692cb
commit e066f3cac9
2 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,7 @@ Additionally, you can specify one of several environment variable (via `-e`) to
* `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). If the server is non-local, the hostname can also be specified, e.g. `192.168.0.102:80`.
* `NGROK_REGION` - Location of the ngrok tunnel server; can be `us` (United States, default), `eu` (Europe), `ap` (Asia/Pacific) or `au` (Australia)
* `NGROK_LOOK_DOMAIN` - This is the domain name referred to by ngrok. (default: localhost).
* `NGROK_BINDTLS` - Toggle tunneling only HTTP or HTTPS traffic. When `true`, Ngrok only opens the HTTPS endpoint. When `false`, Ngrok only opens the HTTP endpoint
#### Full example

View File

@ -85,7 +85,12 @@ if [ -z "$NGROK_PORT" ]; then
echo "You must specify a NGROK_PORT to expose."
exit 1
fi
ARGS="$ARGS `echo $NGROK_PORT | sed 's|^tcp://||'`"
if [ -n "$NGROK_LOOK_DOMAIN" ]; then
ARGS="$ARGS `echo $NGROK_LOOK_DOMAIN:$NGROK_PORT | sed 's|^tcp://||'`"
else
ARGS="$ARGS `echo $NGROK_PORT | sed 's|^tcp://||'`"
fi
set -x
exec $ARGS