From: Josh Roesslein Date: Sun, 10 Oct 2010 04:06:28 +0000 (-0500) Subject: Open the correct type of HTTP Connection based on the scheme being used. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=64c504ec3fffe2bab38b14efe9b5ad90f52fcff1;p=tweepy.git Open the correct type of HTTP Connection based on the scheme being used. --- 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)