-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
For proxy URL such as http://<proxy_ip>:<proxy_port>, it is not possible to reach the https URL of ipinfo with current plugin.
Problem comes from a reuse of "proxy_type" variable in python code:
- proxy_type is used to build the proxy URL: proxy_url = "{}://{}:{}".format(proxy_type, proxy_host, proxy_port)
- proxy_type is used also to set the proxy to use: proxy_handler = urllib.request.ProxyHandler({proxy_type.lower(): proxy_url})
Problem: if the proxy_type is http, no proxy is set for https.
The following fix hardcode the fact the proxy should be used for https:
proxy_handler = urllib.request.ProxyHandler({"https": proxy_url})
As ipinfo.io URL is accessed via HTTPs, we would advise to use this "hardcoded" fix (for both http and https), as people configuring a proxy in ipinfo app are expecting this proxy to be used whether target URLs are http or https.
A more complicated solution could be to define proxy settings per protocol (one for http, one for https)
Metadata
Metadata
Assignees
Labels
No labels