by JSdev1 · 4y ago · 0 comments
Best solution might be to generate a short-lived one-time-use ticket and pass it in the querystring.
However, websockets are not subject to the same-origin policy, so this exposes you to CSRF [1]. To protect against that, you should check the Origin header on the server side.
[1] https://christian-schneider.net/CrossSiteWebSocketHijacking....