From: Wen Wang <750636248@qq.com> Date: Tue, 24 Apr 2018 03:19:28 +0000 (+0800) Subject: proxies support X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d18b1478ead149efd516bc78bdfc80ceec9c776f;p=tweepy.git proxies support stream api supports proxies now --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 43aa823..a64b271 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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