Browse Source

Merge branch 'master' of https://github.com/wernight/docker-ngrok

liuyuqi-dellpc 4 years ago
parent
commit
b1e28fb482
2 changed files with 7 additions and 1 deletions
  1. 1 0
      README.md
  2. 6 1
      ngrok/entrypoint.sh

+ 1 - 0
README.md

@@ -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

+ 6 - 1
ngrok/entrypoint.sh

@@ -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