Websocket.ConnectionSourceWebSocket connection management with TLS and reconnection support.
Uses tls-eio for pure-OCaml TLS, avoiding OpenSSL dependencies.
Connection state
type config = {host : string;port : int;resource : string;initial_backoff : float;max_backoff : float;ping_interval : float;}Connection configuration
WebSocket connection handle.
Create default configuration for a host and resource path.
val create :
sw:Eio.Switch.t ->
net:'a Eio.Net.t ->
clock:float Eio.Time.clock_ty Eio.Resource.t ->
host:string ->
resource:string ->
?ping_interval:float ->
?buffer_size:int ->
unit ->
tCreate a new WebSocket connection. Does not connect immediately.
Set the subscription message to send on (re)connect.
Get the stream of received messages.
val start_parsing_fiber :
sw:Eio.Switch.t ->
channel_name:string ->
conn:t ->
parse:(string -> 'a list) ->
output_stream:'a Eio.Stream.t ->
unitStart a message parsing fiber that reads from a connection's raw stream, parses messages using the provided function, and adds them to the output stream.
Handles cancellation and errors with consistent logging.