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

- added new env NGROK_BINDTLS which adds the arg
- updated the readme
This commit is contained in:
Chris Kirby 2019-01-04 07:34:39 -05:00 committed by Werner Beroux
parent 1110e66ee3
commit 9a8505d39c
2 changed files with 6 additions and 0 deletions

View File

@ -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_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_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_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 #### Full example

View File

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