From 64c504ec3fffe2bab38b14efe9b5ad90f52fcff1 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Sat, 9 Oct 2010 23:06:28 -0500 Subject: [PATCH] Open the correct type of HTTP Connection based on the scheme being used. --- tweepy/streaming.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index d757f20..8b35b8e 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -99,7 +99,10 @@ class Stream(object): # quit if error count greater than retry count break try: - conn = httplib.HTTPConnection(self.host) + if self.scheme == "http": + conn = httplib.HTTPConnection(self.host) + else: + conn = httplib.HTTPSConnection(self.host) conn.connect() conn.sock.settimeout(self.timeout) conn.request('POST', self.url, self.body, headers=self.headers) -- 2.25.1