Skip to content

mitm-core / WebSocketContext

Type Alias: WebSocketContext ​

WebSocketContext = object

Defined in: src/core/scope/types.ts:135

Contains WebSocket upgrade state and references to the client-side and upstream WebSocket endpoints.

Raw upgrade socket information is also available when applicable.

Properties ​

client? ​

optional client?: NodeWebSocket

Defined in: src/core/scope/types.ts:143

Client-side WebSocket endpoint, when available.


isUpgraded ​

isUpgraded: boolean

Defined in: src/core/scope/types.ts:137

Indicates whether the WebSocket connection has been upgraded.


rawUpgradeSocket? ​

optional rawUpgradeSocket?: Duplex

Defined in: src/core/scope/types.ts:149

Raw socket associated with the client-side upgrade, when available.


subprotocol? ​

optional subprotocol?: string

Defined in: src/core/scope/types.ts:140

Negotiated WebSocket subprotocol, when available.


upgradeHead? ​

optional upgradeHead?: Buffer

Defined in: src/core/scope/types.ts:152

Unconsumed bytes received alongside the HTTP upgrade request, when available.


upstream? ​

optional upstream?: NodeWebSocket

Defined in: src/core/scope/types.ts:146

Upstream WebSocket endpoint, when available.