close code

A number a WebSocket endpoint sends when closing a connection, telling the other side why, such as 1000 for normal closure.

In more detail

It should guide the client’s next step: reconnect, refresh its credentials or stop. Codes 1000 to 1015 are defined by the standard, and applications can use the 4000 to 4999 range for their own meanings.

Related terms

Taught in

References