Skip to content

[WebSocket] Add CloseEvent #50275

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.good first issueIssues that are suitable for first-time contributors.web-standardsIssues and PRs related to web-platform APIs and standards compliance.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions