deno_std
deno_std copied to clipboard
feat req: add enums for WebSocket status
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