I'm having trouble opening a websocket in Chrome. It seems that there is some CORS policy in chrome for websockets.
If I am on www.example.com and attempt to open the websocket at api.example.com it'll say pending on the console network tab, and will fire the onerror with a message
WebSocket connection to 'wss://api.example.com' failed: Connection closed before receiving a handshake response
I came across this issue again. I still haven't figured out why, but making an options (or any other) request to the subdomain first allows the connection to be opened.
This only seems to be a problem with wss connections, and has popped up across multiple domains and certs.