title: How to use tweepy STREAMING API with a proxy?
body: <p>I am aware there is a patch for using the REST API with a proxy and it works for me. But the Streaming API uses a HTTPConnection which cannot be emulated by urllib and urllib2 (as far as I know). Is there any fix for this?</p>
  
  <p>I tried using proxy with port, but it did not work.
  In the streaming.py file, line 153.</p>
  
  <pre><code>    if self.scheme == "http":
                  conn = httplib.HTTPConnection(self.api.proxy_host,self.api.proxy_port, timeout=self.timeout)
              else:
                  conn = httplib.HTTPSConnection(self.api.proxy_host,self.api.proxy_port,timeout=self.timeout)
              self.auth.apply_auth(url, 'POST', self.headers, self.parameters)
              print conn.host
              conn.connect()
              conn.request('POST', self.scheme+'://'+self.host+self.url, self.body, headers=self.headers)
              resp = conn.getresponse()
  </code></pre>
  
  <p>And, <strong>"self.scheme+'://'+self.host+ self.url"</strong> corresponds to - <a href="https://stream.twitter.com/1.1/statuses/filter.json?delimited=length" rel="nofollow">https://stream.twitter.com/1.1/statuses/filter.json?delimited=length</a></p>
  
  <p>I get this error in return - </p>
  
  <pre><code>Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2538,    in run_code
  exec code_obj in self.user_global_ns, self.user_ns
  File "&lt;ipython-input-3-4798d330f7cd&gt;", line 1, in &lt;module&gt;
  execfile('main.py')
  File "main.py", line 130, in &lt;module&gt;
  streamer.filter(track = ['AAP'])
  File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 305, in filter
  self._start(async)
  File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 242, in _start
  self._run()
  File "/usr/local/lib/python2.7/dist-packages/tweepy/streaming.py", line 159, in _run
  conn.connect()
  File "/usr/lib/python2.7/httplib.py", line 1161, in connect
  self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
  ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 143, in __init__
  self.do_handshake()
    File "/usr/lib/python2.7/ssl.py", line 305, in do_handshake
      self._sslobj.do_handshake()
      SSLError: [Errno 1] _ssl.c:504: error:140770FC:SSL      routines:SSL23_GET_SERVER_HELLO:unknown protocol
  </code></pre>