Closed sumitdubey closed 4 years ago
That's for bringing this to my attention. I will have a look at this this week and will try to push a new version.
What version of pyngrok
are you currently running? Will need to decide if this can just be patched in 2.0.x
or if we'll need to cut a hotfix for 1.4.x
as well.
@alexdlaird I was just giving it try with the latest version pyngrok 2.0.1
.
This is similar to
def set_auth_token(token, ngrok_path=None, config_path=None)
So, a small patch/hotfix will be helpful for people.
Circling back to this, I don't believe this should need a hotfix. The region
param should be passed as part of options
, the same way hostname
is (https://ngrok.com/docs#http-custom-domains). Does this not work for you?
public_url = ngrok.connect(options={'hostname':'example.com', 'region': 'in'})
Apologies, I now see from the stacktrace that I believe this is what you were actually trying. I don't see the same error, but I also don't have a reserved domain. Let me play around with this to try to figure out why ngrok
is throwing this error, but I believe whatever the fix is, you'll still want to pass the region in the options
param as you were doing, not in a set_region
method. Will get back to you when I've investigated further.
Unfortunately, I'm unable to reproduce this. Wether I use public_url = ngrok.connect(options={'hostname':'example.com', 'region': 'in'})
or ngrok http 8080 -hostname=example.com -region=in
(from the command line using pyngrok
), both work and properly start ngrok
using the in
region.
This appears to be an issue with ngrok
and not pyngrok
, as the parameter is being passed and the error you're getting is a response from ngrok
.
However, a workaround should be to simply edit your ngrok
config file and specify the region there (https://ngrok.com/docs#config-examples). Edit ~/.ngrok2/ngrok.yml
and specify region: in
there, then try again (this time without specifying region
in your options
and just give the hostname
) and it should work for you.
Describe the Bug I have a paid version of ngrok and thus a reserved hostname for region in. When I try to connect ngrok tunnel following
public_url = ngrok.connect(options={'hostname':'example.com'})
I get following region error as default region is us:Steps to Reproduce
public_url = ngrok.connect(options={'hostname':'example.com'})
Pass options with reserved hostname with region other than usExpected Behavior There should be a function like
ngrok.set_region("<REGION>")
like we havengrok.set_auth_token("<NGROK_AUTH_TOKEN>")