Defjs
Core

WebSocketConnectionInfo

Connection metadata for the current WebSocket generation.

@defjs/core · Type

Signature

interface WebSocketConnectionInfo {
  extensions?: string;
  generation: number;
  protocol?: string;
  url?: string;
}
  • url is the URL the socket reports.

  • protocol is the negotiated subprotocol and extensions the negotiated extensions. Both are undefined when the socket reports an empty string.

  • generation counts the physical sockets that reached open: 1 after the first open, one more after each reconnect. A snapshot taken before any open has 0.

session.connection exposes the session's current public connection info. The connection in the operation result preserves the first successful snapshot only for a native Defjs session or a wrapper forwarding the same live connection object. Custom sessions and wrappers that transform connection instead return their current public connection. Sharing closed cannot bypass URL sanitization or metadata filtering, and Defjs does not reconstruct first-connection metadata from arbitrary transformations.

Members

Prop

Type

extensions? string | undefined
generation number
protocol? string | undefined
url? string | undefined
Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao