3 ms·
Really appreciating bun's ability to set custom WebSocket headers. Incidentally, what's up with the resistance against this from the standards maintainers? [1]
by xg15 4y ago
Really appreciating bun's ability to set custom WebSocket headers.
Incidentally, what's up with the resistance against this from the standards maintainers? [1]
The request exists since 2017, there are tons of use cases and developer interest, but Chrome refuses implementation on technicalities. What gives?
[1] https://github.com/whatwg/websockets/issues/16 https://github.com/whatwg/websockets/issues/16
- RedShift1 4y agoTheir reasoning is explained in the issue you linked. IMO this sounds like a YAGNI thing. You can pass extra information via the URL, query parameters, cookies work just like normal HTTP, etc... And if those options don't work you can just exchange whatever information you want inside the websocket connection. I can't think of a use case that requires a custom header.
- danr4 4y agoI'm working on a project with websockets and I hate working around unsupported headers. biggest problem is passing json web tokens, requiring us to have short lived cookies just for authenticating. Yes, we can always "just exchange information" but this requires custom, non-standard logic, for such a ubiquitous use case.