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

Enable use of proxies & document its usage #7

Open
dmpe opened this issue Feb 24, 2020 · 1 comment
Open

Enable use of proxies & document its usage #7

dmpe opened this issue Feb 24, 2020 · 1 comment

Comments

@dmpe
Copy link

dmpe commented Feb 24, 2020

Hi @avelkoski,
can we document use of proxies and subsequent use of this python module ?
Or, if necessary, expose ProxyHandler ?

https://github.com/avelkoski/FRB/blob/master/fred/helpers/__init__.py#L141
https://github.com/avelkoski/FRB/blob/master/fred/__init__.py

What I am trying is

import os
import urllib
proxy = 'http://username:password@enterprise proxy/'

os.environ['http_proxy'] = proxy 
os.environ['HTTP_PROXY'] = proxy
os.environ['https_proxy'] = proxy
os.environ['HTTPS_PROXY'] = proxy

Then, which works well

import os
print(os.environ.get('http_proxy'))
print(os.environ.get('https_proxy'))

Then:

from fred import Fred
fred = Fred(api_key='xxx', response_type='dict') 
params = {'limit':10}
res = fred.release.tags(51,params=params)
print(res)

fails with <urlopen error [Errno 111] Connection refused>

However, R and Python with different use case but still with proxy do seem to work.

@dmpe
Copy link
Author

dmpe commented Mar 1, 2020

Would you be willing to review a PR if I provide it ? @avelkoski

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