WebSocketOptions

external interface WebSocketOptions(source)

Properties

Link copied to clipboard
abstract external var headers: ReadonlyRecord<String, String>?

Extra HTTP headers to send with the opening handshake.

Link copied to clipboard
abstract external var origin: String?

Value of the Origin header to send with the opening handshake. Defaults to the http(s) equivalent of the WebSocket URL's origin (e.g. connecting to wss://api.example.com sends Origin: https://api.example.com), so that the connection is treated as same-origin by the server and by SameSite cookie rules.

Link copied to clipboard
abstract external var partition: String?

The name of the partition the connection is associated with. Defaults to the empty string, which corresponds to the default session. If session is provided, partition is ignored.

Link copied to clipboard
abstract external var protocols: Any?

Requested WebSocket subprotocols.

Link copied to clipboard
abstract external var session: Session?

The Session the connection is associated with.

Link copied to clipboard
abstract external var useSessionCookies: Boolean?

Whether to send cookies from the session with the opening handshake and store cookies received in the handshake response. Default is false.