Closed alexdlaird closed 9 months ago
You also need to remove schemes
parameter when is a labeled tunnel
You also need to remove
schemes
parameter when is a labeled tunnel
I couldn't find a scenario where this was the case, could you provide me with an example where the tests fail for this?
Note that you can't pass labels
to connect, that'll never work due to how the ngrok
API works. This functionality will only work through tunnel_definitions
(i.e. setting it in the ngrok
config file and starting that tunnel via its name
).
I couldn't find a scenario where this was the case, could you provide me with an example where the tests fail for this?
http_tunnel = ngrok.connect(
addr="http://localhost:3000",
bind_tls=True,
labels= ["edge=edghts_example"]
)
I couldn't find a scenario where this was the case, could you provide me with an example where the tests fail for this?
http_tunnel = ngrok.connect( addr="http://localhost:3000", bind_tls=True, labels= ["edge=edghts_example"] )
Ah, I see, bind_tls
is a legacy ngrok
v2 param. It upconverts to schemes
, but in either case, that param is incompatible with labels
. The solution is never pass either bind_tls
or schemes
to connect()
when you are using labels
. I'd rather ngrok
continue to throw the error if that, proto
, or other incompatible params are passed (like a Bad Request).
Patch coverage: 86.48%
and project coverage change: -0.45%
:warning:
Comparison is base (
356c05a
) 93.32% compared to head (04aaef2
) 92.87%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
As this PR currently stands is how I'm proposing we implement this. Going to sit on it for a day or two while I implement similar support in java-ngrok
, then I'll merge this. You'll see basic support for ngrok
's Cloud Edge then in pyngrok
6.1.0.
Sister PR in java-ngrok
: https://github.com/alexdlaird/java-ngrok/pull/76
Description Add support for
labels
in tunnel definitions. This does not add fully parity support forngrok
's new Cloud Edge feature set, but it does allow its basic functionality to be used withpyngrok
now.Issues
110, #113, #116
Type of Change
Testing Done A clear and concise description of the new tests added to validate the change as well as any manual testing done.
Checklist