alexdlaird / pyngrok

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

Support Proxies and CA Files #47

Closed alexdlaird closed 4 years ago

alexdlaird commented 4 years ago

Describe the Feature When downloading the ngrok bindary, pyngrok uses urlopen. This means we go through the default filter chain, as documented here, so if the HTTP_PROXY environment variable is used, or if another default Python ProxyHandler is setup, this should work fine. However, this is not documented anywhere in pyngrok's docs.

In addition, urlopen takes a cafile or capath, but we never pass these vars. These optional variables should be accepted (and documented alongside the HTTP_PROXY usage) so people who are behind a corporate or similar proxy can still make use of pyngrok.

Describe Alternative Solutions/Workarounds In the meantime, this can be worked around by using reviewing Python's own documentation on how default ProxyHandler's work (linked above) and extending what is in installer.py. Additionally, pyngrok only calls the code in installer.py if no ngrok binary is found at the given ngrok_path, so pre-installing the ngrok binary using your own code prior to calling any method in the ngrok module, and/or implementing your own install_ngrok() and _download_file(), should let you workaround this until it is supported.

alexdlaird commented 4 years ago

This will be resolved in 4.1.0, as documented here and also in the installer modules methods.