Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
d18b1478
Unverified
Commit
d18b1478
authored
Apr 24, 2018
by
Wen Wang
Committed by
GitHub
Apr 24, 2018
Browse files
proxies support
stream api supports proxies now
parent
dfa8e1ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
d18b1478
...
...
@@ -220,6 +220,9 @@ class Stream(object):
self
.
body
=
None
self
.
retry_time
=
self
.
retry_time_start
self
.
snooze_time
=
self
.
snooze_time_step
# Example: proxies = {'http': 'http://localhost:1080', 'https': 'http://localhost:1080'}
self
.
proxies
=
options
.
get
(
"proxies"
)
def
new_session
(
self
):
self
.
session
=
requests
.
Session
()
...
...
@@ -247,7 +250,8 @@ class Stream(object):
timeout
=
self
.
timeout
,
stream
=
True
,
auth
=
auth
,
verify
=
self
.
verify
)
verify
=
self
.
verify
,
proxies
=
self
.
proxies
)
if
resp
.
status_code
!=
200
:
if
self
.
listener
.
on_error
(
resp
.
status_code
)
is
False
:
break
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment