deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

feat req: add enums for WebSocket status

Open lowlighter opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

The Websocket.close accept two args, an exit code and a reason, similar to http code and status text. This is defined by https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1

Like what is currently provided for @std/http, it'd be nice to have a "human-readable" enum of defined code.

Only thing is that I don't think there's a "standard naming", but this could be inferred by the description in the rfc, or try to match the already defined http status

Describe the solution you'd like

Something similar to STATUS_CODE and STATUS_TEXT from @std/http

Describe alternatives you've considered

lowlighter avatar Jul 14 '24 17:07 lowlighter