Skip to content

Allow closing WSMessageHandler stream with a close code #137

Closed
@liautaud

Description

@liautaud

Hi! First of all thanks for the library, it's been really great to use.

Would you be open to adding a way for a WSMessageHandler to close the server stream with .close(code: closeCode) frames in some way or another? The typical use case is closing a WebSocket connection after some unrecoverable error while wanting the client-side to know what the error actually is–in JavaScript, for instance, you can read event.code on a WebSocket "close" event.

I could already implement this behavior by falling back to the more cumbersome WSHandler level, but it seems like a frequent enough use case that it would make sense at the WSMessageHandler level too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions