Browse Source

added support for the bind-tls arg (#29)

- added new env NGROK_BINDTLS which adds the arg
- updated the readme
Chris Kirby 5 years ago
parent
commit
9a8505d39c
2 changed files with 6 additions and 0 deletions
  1. 1 0
      README.md
  2. 5 0
      entrypoint.sh

+ 1 - 0
README.md

@@ -47,6 +47,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).
   * `NGROK_REGION` - Location of the ngrok tunnel server; can be `us` (United States, default), `eu` (Europe), `ap` (Asia/Pacific) or `au` (Australia)
+  * `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
 

+ 5 - 0
entrypoint.sh

@@ -26,6 +26,11 @@ else
   NGROK_PORT="${NGROK_PORT:-80}"
 fi
 
+# Set the TLS binding flag
+if [ -n "$NGROK_BINDTLS" ]; then
+  ARGS="$ARGS -bind-tls=$NGROK_BINDTLS "
+fi
+
 # Set the authorization token.
 if [ -n "$NGROK_AUTH" ]; then
   ARGS="$ARGS -authtoken=$NGROK_AUTH "