OxL Справочник OxL
РусскийEnglish

data WsConfig

Settings of WebSocket.connect.

Example:

oxl✓ проверяется в CI
use std.http { WsConfig }

fn main() io {
  let cfg = WsConfig{ timeout: 5s, maxMessage: 65536, protocols: "v2, v1", compress: true }
  print("{cfg.protocols}")
}
Вывод
v2, v1
pub(api) data WsConfig

С версии. 1.0.0-beta

Поля

pub(api) timeout: Duration? = none

Bound for connecting and the opening handshake; none = no limit.

pub(api) maxMessage: i64 = 16777216

Largest accepted message in bytes.

pub(api) protocols: str = ""

Offered subprotocols (comma separated).

pub(api) compress: bool = false

Offer permessage-deflate (RFC 7692); WebSocket.compressed tells whether the server agreed.

pub(api) ca: str = ""

wss: file with the certificate authorities to trust.

pub(api) caPem: str = ""

wss: trust anchors as PEM text.

pub(api) insecureSkipVerify: bool = false

wss: skip certificate verification (tests only).

pub(api) verifyHostname: bool = true

wss: check that the certificate names the host.

Определено в: std/http/http.oxl:2188

См. также