title: Socket.io with apache proxy
body: <p>im trying to set up proxyng with apache to be able to use socket.io in my nodejs application. But i recieve this error message on the client side:</p>
  
  <pre><code>WebSocket connection to 'wss://example.com/tools/socket.io/?EIO=3&amp;transport=websocket&amp;sid=eOGwJSC14TTWhHRMAAAR' failed: Error during WebSocket handshake: Unexpected response code: 400
  </code></pre>
  
  <p>Heres my apache configuration:</p>
  
  <pre><code>     &lt;VirtualHost *:443&gt;
              ServerName example.com
              ServerAlias example.com
              #SSLRequireSSL
              SSLProtocol all -SSLv2  -SSLv3
              SSLCompression off
              SSLHonorCipherOrder on
              SSLEngine on
              SSLCertificateFile /etc/ssl/main.pem
              SSLCertificateKeyFile /etc/ssl/dec_ssl.key
              SSLCertificateChainFile /etc/ssl/sub.class1.server.ca.pem
              SSLCACertificateFile /etc/ssl/main.pem
              SSLProxyEngine On
  
              ProxyPreserveHost On
              ProxyRequests off
      &lt;/VirtualHost&gt;
  
      &lt;Location /tools/&gt;
              ProxyPass http://localhost:8181/
              ProxyPassReverse http://localhost:8181/
      &lt;/Location&gt;
  </code></pre>
  
  <p>And here is client side code:</p>
  
  <pre><code>socket = io.connect("https://example.com",{path:'/tools/socket.io'});
  socket.on("connect", function () {
      console.log("socketio Connected to server!");
  });
  </code></pre>
  
  <p>What else i need to add to apache configuration to get rid of this error?</p>
  
  <p>EDIT: My apache version: Server version: Apache/2.4.6 (CentOS)</p>