Allow use of builtin Node WebSocket when available#26682
Allow use of builtin Node WebSocket when available#26682sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
|
Actually Claude suggests we also need to update the event handlers, see the second half of changes in Because |
Good point. I decided to cleanup that code a bit first: #26683 |
bca8eae to
7acdc56
Compare
Node v21 and up have native WebSocket support. This change makes the import of the external `ws` module conditional so it will only run on older versions of node. See emscripten-core#26676
|
Done. PTAL |
|
Looks like we cannot switch just yet because node is sending the subprocols headers in the format of |
|
@sbc100 should we maybe fix this in nodejs to behave the same as in browsers? There are many different websockify implementations and it may take a long time for this fix to end up on server distributions. |
|
Are you suggesting an upstream node fix or some kind of monkey patching at runtime? Also, are you sure of the browser behavour? I didn't confirm yet |
Node v21 and up have native WebSocket support. This change makes the import of the external
wsmodule conditional so it will only run on older versions of node.See #26676