I’ve just started using WebSockets, and noticed I can’t pass JWT token in the same way as I do with HTTP – through Authorization: Bearer _TOKEN_
, since browsers do not seem to support custom headers for WebSocket upgrade. I can’t find any limitation in RFC 6455, so it’s seems to be a browser-only issue.
I believe browsers should support custom headers in WebSocket upgrade requests (with same rules as XHR/Fetch), if just for consistency between different technologies.