title: client websocket connect through proxy
body: <p>I'm using the <a href="https://pypi.python.org/pypi/websockets" rel="nofollow noreferrer">websockets</a> module, but it doesn't support connecting though my corporate proxy for a client connection:</p>
  
  <pre><code>&gt;&gt;&gt; import asyncio, websockets
  &gt;&gt;&gt; async def connect(uri):
  ...     async with websockets.connect(uri) as websocket:
  ...         pass
  ...
  &gt;&gt;&gt; asyncio.get_event_loop().run_until_complete(connect('ws://myhost.com/path/'))
      ....
  ConnectionRefusedError: [Errno 10061] Connect call failed ('myhost.com', 80)
  </code></pre>
  
  <p>However if use curl with my <code>http_proxy</code> env var set, it works:</p>
  
  <pre><code>$ curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: MTIzNDEyMzQxMjM0MTIzNA==" http://myhost.com/path/
  HTTP/1.1 101 Switching Protocols
  Server: nginx/1.13.6
  Date: Fri, 10 Nov 2017 14:51:00 GMT
  Upgrade: websocket
  Sec-WebSocket-Accept: s+CT5bkW5F3N2/5JUXrCPtLHn68=
  Connection: Upgrade
  </code></pre>
  
  <p>What are my best options? Some other module for making client-websocket connects?</p>