Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.