Skip to content

Commit

Permalink
Add domain option for tunnel creation (#312)
Browse files Browse the repository at this point in the history
* Add domain option for tunnel creation

* Update documentation for the static free domain
  • Loading branch information
glxgxr authored May 21, 2024
1 parent 99f498c commit 9904823
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,19 @@ The `bind_tls` option is now `scheme`. When `bind_tls` was true (the default), n

The `auth` option, also available as `httpauth`, is now just `basic_auth`. Note also that the password for `basic_auth` must be between 8 and 128 characters long.

### Using the ngrok static free-domain

In April 2023, ngrok [introduced the ngrok static free-domain](https://ngrok.com/blog-post/new-ngrok-domains), which brings you a static subdomain even for free accounts. To make use of it, just use the `domain` option when creating a tunnel. Example:

```ts
ngrok.connect({
domain: "xxx.ngrok-free.app"
authtoken: "YOUR-AUTH-TOKEN"
})
```

__Note__: Please make sure to __either__ use the `subdomain` or the `domain` option. Using both would lead to using the subdomain only.

## Upgrading to version 4

The main impetus to update the package was to remove the dependency on the deprecated `request` module. `request` was replaced with `got`. Calls to the main `ngrok` functions, `connect`, `authtoken`, `disconnect`, `kill`, `getVersion` and `getUrl` respond the same as in version 3.
Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const tunnelProperties = [
"key",
"terminate_at",
"labels",
"domain",
];

const globalProperties = [
Expand Down

0 comments on commit 9904823

Please sign in to comment.