title: Reverse proxy and Socket.io, failed websocket handshake
body: <p>I am running a little website using IIS 7.5 on Windows Server 2008 R2.
  I've got a node.js application too running on port 3000.</p>
  
  <p>Http calls from the website (client browser) are reverse proxied from <code>http://example.com/node/whatever</code> to <code>http://localhost:3000/whatever</code>. Everything works fine so far.</p>
  
  <p>The problem is when i try to use socket.io.</p>
  
  <p>I am receiving:</p>
  
  <pre><code>    WebSocket connection to 'ws://example.com/socket.io/?EIO=3&amp;transport=websocket&amp;sid=adb9WRpoMFYRoS0vAAAB' 
  failed: Error during WebSocket handshake: Unexpected response code: 502 
  </code></pre>
  
  <p>I am pretty sure, if i am not wrong, that:</p>
  
  <p>It does forward the initial request to my server as the initial request to a websocket server is a standard HTTP request (with some additional headers). IIS does know about that and simply forwards the request. However, upon receiving the websocket request the websocket server sends a 101 response and switch into websocket mode. IIS does not understand the websocket traffic and it is not able to proxy that.</p>
  
  <p>Is there a trick or solution to configure the reverse proxy for the ws:// adresses?</p>