Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/protocol / close-codes

close-codes

Custom WebSocket close-code taxonomy used by @graphorin/server and @graphorin/client. The numeric values live in the 4xxx application-private range per RFC 6455 § 7.4.

Type Aliases

Type AliasDescription
GraphorinCloseReasonDiscriminator for every Graphorin-defined close code. The matching numeric value is exposed via CLOSE_CODE_VALUES.

Variables

VariableDescription
CLOSE_CODE_VALUESNumeric close-code constants. The pair (value, reason) round-trips via closeCodeReason / closeCodeFor.

Functions

FunctionDescription
closeCodeForReturn the numeric close code for a Graphorin reason discriminator.
closeCodeReasonResolve a numeric close code back to its Graphorin reason discriminator. Returns undefined for codes outside the Graphorin range so callers can still surface the raw RFC 6455 reason for unrelated codes.