Problem:
In some situations and countries, ProtonVPN API servers are not reachable due to the reason that they are blocked or filtered. This causes problem for the call_api() function, and as a result, protonvpn_cli doesn't work at all.
Solution:
This pull requests adds support to configure a proxy to be used when calling ProtonVPN API servers. It'll be only used to call the API servers, and does not meant to establish VPN Connection through the provided proxy.
It also adds proxy support to the relevant functions calling call_api(), so, whenever it is needed, it can be disabled by passing proxy=False parameter. Moreover, it only uses the proxy when the user enables and configures the proxy, and when it's not connected to ProtonVPN (as API servers will be reachable when connected).
Changes:
Modify call_api() to support proxy
Add proxy parameter to:
pull_serer_data()
get_ip_info()
wait_for_network()
Add check_proxy()
Add default proxy values to init_cli()
Add proxy configuration support to configure_cli()
Add set_metadata_proxy() to configure proxy
Update USAGE.md
Issues:
Issues such as #97, #232, #234, #235 can be fixed with using a temporary proxy to fetch necessary data from ProtonVPN API servers.
Problem: In some situations and countries, ProtonVPN API servers are not reachable due to the reason that they are blocked or filtered. This causes problem for the call_api() function, and as a result, protonvpn_cli doesn't work at all.
Solution: This pull requests adds support to configure a proxy to be used when calling ProtonVPN API servers. It'll be only used to call the API servers, and does not meant to establish VPN Connection through the provided proxy.
It also adds proxy support to the relevant functions calling call_api(), so, whenever it is needed, it can be disabled by passing
proxy=False
parameter. Moreover, it only uses the proxy when the user enables and configures the proxy, and when it's not connected to ProtonVPN (as API servers will be reachable when connected).Changes:
proxy
parameter to:Issues: Issues such as #97, #232, #234, #235 can be fixed with using a temporary proxy to fetch necessary data from ProtonVPN API servers.