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 in 'query_client.py' #6

Open
mrdos010 opened this issue Apr 15, 2021 · 1 comment
Open

Proxy Support in 'query_client.py' #6

mrdos010 opened this issue Apr 15, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@mrdos010
Copy link

mrdos010 commented Apr 15, 2021

Hi,

I noticed that the 'query_client.py' doesn't support Proxy. is there anyway to use proxy with the query_client?
I tried to add Proxy but now i dont know where is the Problem (Client ID or Proxy).

proxies = {"http": "127.0.0.1:3128", "https": "127.0.0.1:3128"}
request_id = request_snapshot(request_data)
r = requests.get(**request_data, proxies=proxies)

Thanks!

@santosomar
Copy link
Contributor

You could add something like this (similar to what you have above):

http_proxy  = "http://127.0.0.1:3128"
https_proxy = "https://127.0.0.1:3128

proxyDict = { 
              "http"  : http_proxy, 
              "https" : https_proxy
            }

r = requests.get(url, headers=headers, proxies=proxyDict)

However, to avoid that headache you can also do this via the HTTP_PROXY, HTTPS_PROXY environment variables in Linux:

export HTTP_PROXY=127.0.0.1:3128
export HTTPS_PROXY=127.0.0.1:3128

One Windows there is a set https_proxy=127.0.0.1 variable, but I am not that intimately familiar with Windows, as I am with Linux.

@santosomar santosomar added the enhancement New feature or request label May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants