Skip to content

Use the global WebSocket class for 'websocket' transport #722

@kettanaito

Description

@kettanaito

Hi!

I would like to ask if there are any plans on updating SocketIO toolchain to rely on the global WebSocket class that has been available in Node.js since 2023. Presently, SocketIO hard-codes the 'websocket' transport to use ws in Node.js. I would like to have an API that would allow me to use the global WebSocket class instead, similar to how it works in the browser.

Given that SocketIO already works with the browser's WebSocket, and the Node.js (Undici's) implementation of the protocol is faithful, I suppose that supporting this will not require any significant changes to the library. On the other hand, it would help unblock apps and test setups that would benefit greatly from reusing the same global APIs (which is a huge reason the ecosystem shares more and more of them with every passing year).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions