-1

How would I write a Python program that automates ngrok connections? I've tried using pyngrok, but I want to display an https URL and it always returns http.

4

1 回答 1

1

Per the pyngrok docs, two tunnels are opened by default, one http, one https. Just use bind_tls=True if you only want the https tunnel and it will be returned.

from pyngrok import ngrok

https_tunnel = ngrok.connect(bind_tls=True)

If you want to know how pyngrok does this, its code is open source.

于 2021-03-16T16:32:13.903 回答