title: WebSocket over SSL: Cloudflare
body: <p>I have a website behind cloudflare. I need to enable websockets over SSL without turning off cloudflare support. I have a PRO plan and hence won't get the new websocket support. I am using Nginx to proxy a SSL connection to a web socket running on a node server. Now, I read somewhere that cloudflare could work with  approved <a href="https://support.cloudflare.com/hc/en-us/articles/200169156-Which-ports-will-CloudFlare-work-with-">ports</a> would support websockets. Hence, I'm using 8443 for the Nginx port and another port for the node server. Using wscat it returns a 200 error.</p>
  
  <pre><code>$ wscat -c wss://xyz.com:8443
  error: Error: unexpected server response (200)
  </code></pre>
  
  <p>I know that the websocket is expecting a 101 code. However, if I visit <a href="https://xyz.com:8443">https://xyz.com:8443</a>, I can see the page displayed by the node server telling me proxy is working. Also, once I turn off cloudflare support, the websocket starts working. Any clues to get this working. I know I can create a subdomain but I'd prefer running the websocket behind cloudflare.</p>