Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Support for API Servers #237

Closed
wants to merge 6 commits into from
Closed

Conversation

iiriix
Copy link

@iiriix iiriix commented Sep 22, 2020

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.

ryanprior and others added 6 commits June 2, 2020 22:11
* Ported CLI to argparse, based on OO programming paradigm

* Added descriptive comments

* Updated usage string

* Added logging

* Updated exmaples

* Removed function based CLI code

* Removed docopt dependency

* Added usage constant

* Added back the PVPN_WAIT environment variable

* Addressed Flake8 issues

* Examples are now inline with the CLI

* Removed unncesessary comment

* Cleaned up code and improved readability

* Removed dependencies still they are no longer needed

* Updated inline command

* Allow uppercase protocol with -p

* Allign help message

* Return missing -p to example

Co-authored-by: Alexandru Cheltuitor <31934100+calexandru2018@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants