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, bool shared = false}) → Future<HttpServer>
Binds an HttpServer for rpcWebSocketConnections that bounds what a connection may send before its upgrade request ends.
rpcWebSocketChannel(WebSocket socket) → WebSocketChannel
A WebSocketChannel over a dart:io socket that 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> that RpcWebSocketServer consumes, applying server-side keepalive.