alexdlaird / pyngrok

A Python wrapper for ngrok
https://pyngrok.readthedocs.io
MIT License
425 stars 59 forks source link

ngrok.connect returns only http public url #9

Closed nejdetckenobi closed 5 years ago

nejdetckenobi commented 5 years ago

By default, when we use ngrok.connect() it creates HTTP and HTTPS tunnels at the same time.

After connecting, when we run ngrok.get_tunnels() we can see that. But ngrok.connect returns the HTTP url only. It should return both HTTP and HTTPS urls.

alexdlaird commented 5 years ago

You could also probably make the case that connect() should return the actual NgrokTunnel object (or a list of them, per your suggestion) rather than just the public_url. The reason we don't do this is because we don't want to block on get_tunnels() before what the known public_url (which is predictable) will be.

The actual state of the tunnels themselves (i.e. what would be defined in NgrokTunnel) and how many tunnels were opened (i.e. the ngrok binary, not pyngrok, opens a https tunnel as a convenient side effect when http is given) isn't guaranteed to be known at this point (and also differs between ngrok versions), so we don't want to bake this constraint in to connect().