io library
dart:io-only helpers for rpc_dart_websocket.
Kept out of the main library on purpose: rpc_dart_websocket.dart is
web-safe (the package has a browser smoke test) and importing dart:io
there would break that. Anything here needs a real socket and a real
server, so it only makes sense on the VM.
Functions
-
bindRpcWebSocketHttpServer(
Object address, int port, {RpcSecurityPolicy policy = const RpcSecurityPolicy(), int? maxHeaderBytes, Duration? headerTimeout = const Duration(seconds: 60), int? maxConnections, int backlog = 0, bool v6Only = false, }) → Future< HttpServer> -
Binds an HttpServer for
rpcWebSocketConnectionsthat bounds what a connection may send before its upgrade request ends. -
rpcWebSocketChannel(
WebSocket socket) → WebSocketChannel -
A
WebSocketChannelover a dart:iosocketthat its caller keeps and may close itself — a server that upgraded it and closes every socket on stop. -
rpcWebSocketConnections(
HttpServer server, {Duration? pingInterval = const Duration(seconds: 30), dynamic protocolSelector(List< String> protocols)?, CompressionOptions compression = CompressionOptions.compressionOff, Set<String> ? allowedOrigins, bool allowUpgrade(HttpRequest request)?, RpcSecurityPolicy? policy, LogScope? logger, Duration? frameProgressTimeout = const Duration(seconds: 60)}) → Stream<WebSocketChannel> -
Turns an HttpServer into the
Stream<WebSocketChannel>thatRpcWebSocketServerconsumes, applying server-side keepalive.