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

Cannot access tweets through a ResultStream from behind a proxy #147

Open
finnhacks42 opened this issue Jan 24, 2022 · 2 comments
Open

Cannot access tweets through a ResultStream from behind a proxy #147

finnhacks42 opened this issue Jan 24, 2022 · 2 comments
Labels

Comments

@finnhacks42
Copy link

Describe the bug
Trying to stream results from behind a proxy fails with a connection refused error.

HTTPS_PROXY and HTTP_PROXY environment variables are set but are ignored by ResultStream due to line 48 in result_stream.py - in make_session session.trust_env=False

To Reproduce
From behind a proxy,

os.environ['HTTPS_PROXY']='xxx'
os.environ['HTTP_PROXY']='yyy'
creds = load_credentials('twitter_keys.yml',env_overwrite=False)
rule = gen_rule_payload('beyonce', from_date='2022-01-01',to_date='2022-01-07')
rs = ResultStream(rule_payload=rule,**creds)
tweets = list(rs.stream())
@finnhacks42
Copy link
Author

If trusting the contents of the environment variables would break other things, then an option could be created to pass proxy arguments when constructing ResultStream

@bunnyhero
Copy link

This is affecting me too. It looks like session.trust_env=False was added by #48 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants