Open the correct type of HTTP Connection based on the scheme being used.
authorJosh Roesslein <jroesslein@gmail.com>
Sun, 10 Oct 2010 04:06:28 +0000 (23:06 -0500)
committerJosh Roesslein <jroesslein@gmail.com>
Sun, 10 Oct 2010 04:06:28 +0000 (23:06 -0500)
tweepy/streaming.py

index d757f20bac7ba203e01419fb0edc4be4f3cdebc9..8b35b8e7d979e44439d8e71ffc05408a54beb193 100644 (file)
@@ -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)