WebSocketListener
WebSocketListener copied to clipboard
How to bypass CORS?
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?
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.