Skip to content

WebSocketUpgradeResult

type WebSocketUpgradeResult = void | FlareResponse | WebSocketRefusal

What one upgrade hook run decides.

  • nothing: proceed with the handshake.
  • FlareResponse: deny the handshake; readable by HTTP-speaking clients (curl, server clients).
  • WebSocketRefusal: accept then immediately close; the refusal a BROWSER can read (a failed handshake exposes nothing to its JavaScript, while a close frame’s code and reason arrive in the close event).

Learn: Overview