denoland / denoland/std

feat req: add enums for WebSocket status

Open
#5,436 3 comments 2 reactions 0 assignees View on GitHub
feedback welcome suggestion
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**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`](https://jsr.io/@std/http/doc/~/STATUS_CODE) and [`STATUS_TEXT`](https://jsr.io/@std/http/doc/~/STATUS_TEXT) from `@std/http`

**Describe alternatives you've considered**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.