bubenshchykov / ngrok

Expose your localhost to the web. Node wrapper for ngrok.
https://ngrok.com
2.33k stars 317 forks source link

Add domain option for tunnel creation #312

Closed glxgxr closed 6 months ago

glxgxr commented 1 year ago

Since April 2023 it is possible to configure the domain option on tunnel creation with the ngrok client, so that you are able to use the free domain (without having to pay for a static subdomain). This merge request makes it possible to use it, otherwise it would just be ignored.

Reference: https://ngrok.com/blog-post/new-ngrok-domains https://ngrok.com/docs/secure-tunnels/ngrok-agent/reference/ngrok/#flags-12

coffeduong commented 1 year ago

@glxgxr I've tried apply your code in utils.js but it still random domain. I think it need to change other places too. About document, we should update more in Options section, set domain in example code will make easier for understand.

glxgxr commented 1 year ago

@coffeduong What options did you use to initiate the tunnel? I am using

        const conf = {
            domain: "xxx.ngrok-free.app",
            region: "eu",
            addr: "3007",
            authtoken: "xxx"
        };

and it works fine.

Update: I'll update the documentation with an example to make it a little bit clearer.

coffeduong commented 1 year ago

@glxgxr @bubenshchykov the code is working, please merge it for the community

pschild commented 1 year ago

Hi, Very interested in this🔥Are there any plans when this PR is going to be merged? 😃 Thanks!

glxgxr commented 1 year ago

@philnash Any chances in merging this pull request? I think this could be very helpful for many services that use this package. 🙂

shamoons commented 1 year ago

Would love to have this in

tnarik commented 6 months ago

please, @bubenshchykov , merge this, as it is a very simple change that mostly just add the new additional option supported by the actual ngrok client to this library. Patching a local version of ngrok is trivial, but it would be so much better if it gets officially supported.

bubenshchykov commented 6 months ago

better later than never! :) merged... now trying to restore my npm access to publish, cc @philnash in case you can publish sooner