1

When I use PyNgrok library to open http port it creates 2 tunnels with http and https protocols. But when I use ngrok client provided by them, it only opens https tunnel. Is it possible to open only https tunnel with pyngork?

ngork http 8080
from pyngrok import ngrok

# opening http tunnel
ngrok.connect(8080, 'http')

# logic to maintain tunnel
# ...

print(ngrok.get_tunnels())
# outputs http and https tunnel links
  • 2
    In the pyngrok documentation you can read that: "ngrok’s default behavior for http when no additional properties are passed is to open two tunnels, one http and one https. pyngrok’s connect method will return a reference to the http tunnel in this case. If only a single tunnel is needed, pass bind_tls=True and a reference to the https tunnel will be returned." – Bloodbee Sep 16 '22 at 08:16
  • This comment is the correct answer, and [here are the docs](https://pyngrok.readthedocs.io/en/latest/index.html) for reference. – alexdlaird Sep 16 '22 at 12:39

0 Answers0