Skip to content

WebSocket proxy throws when forwarding reserved close code 1006 #260

@iori0311

Description

@iori0311

When the proxy receives a close event with code 1006 (or other reserved codes), it forwards that code with ws.close(event.code, event.reason).

This throws at runtime:
TypeError: Invalid WebSocket close code: 1006

What I observed:

  • one side of the WebSocket closed with code 1006
  • proxy tried to forward 1006 directly
  • request handling hung after the exception

Expected behavior:

  • reserved close codes are not sent in outbound close frames
  • proxy closes with a valid fallback code instead

Related PR: #259

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions