WebSocketListener icon indicating copy to clipboard operation
WebSocketListener copied to clipboard

How to bypass CORS?

Open hvta opened this issue 6 years ago • 1 comments

I'd like to use the WS listener with socket.io on the client side (where the WS and HTTP servers are under different domains). I get a message saying thet Access-Control-Allow-Origin header is not set. How can it be set on the srver side?

hvta avatar Apr 11 '18 07:04 hvta

You can hook into the HTTP negotiation with https://github.com/vtortola/WebSocketListener/wiki/Hooking-into-the-HTTP-negotiation

However, as far as I remember, socket.io is more than just a websocket. In the other hand, this component is pure raw websocket protocol, no fallback to other transports.

vtortola avatar Apr 13 '18 23:04 vtortola