Skip to content

[WebSocket] Add CloseEvent #50275

Closed
@regseb

Description

@regseb

What is the problem this feature will solve?

In Node.js v21 with --experimental-websocket, the CloseEvent class isn't defined. This event is sent to clients using WebSockets when the connection is closed.

What is the feature you are proposing to solve the problem?

Add the CloseEvent class in the global scope (behind --experimental-websocket flags). I found it in undici but it isn't exported. Or add the CloseEvent class next to MessageEvent (directly in Node.js).

What alternatives have you considered?

No response

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.good first issueIssues that are suitable for first-time contributors.web-standardsIssues and PRs related to Web APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions