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

recognize and set proxy #11

Open
kel50 opened this issue Apr 13, 2018 · 0 comments
Open

recognize and set proxy #11

kel50 opened this issue Apr 13, 2018 · 0 comments

Comments

@kel50
Copy link

kel50 commented Apr 13, 2018

I'm using this module behind a proxy and had to make some slight modifications for it to work.
So I'd suggest to check the environment for a proxy and set it in httplib2 using PySocks:

import httplib2
# detect presense of proxy and use env varibles if they exist
pi = httplib2.proxy_info_from_environment()
if pi:
    import socks
    socks.setdefaultproxy(pi.proxy_type, pi.proxy_host, pi.proxy_port)
    socks.wrapmodule(httplib2)  

source: https://stackoverflow.com/a/46206122

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

No branches or pull requests

1 participant