ws_client (ws v0.3.0)
View SourceWebSocket client connect for ws:// / wss:// URLs.
The client connects over plain TCP (ws) or TLS (wss), sends the HTTP/1.1 upgrade request, validates the 101 response, and starts a ws_session running in client mode.
HTTP/2 and HTTP/3 client flows piggy-back on an already-established H2/H3 connection owned by the embedder; they are driven through ws_h2_upgrade / ws_h3_upgrade plus a transport adapter the embedder supplies, not through this module.
Summary
Types
-type opts() :: #{handler := module(), handler_opts => term(), subprotocols => [binary()], extensions => [binary()], origin => binary(), extra_headers => [{binary(), binary()}], timeout => timeout(), max_handshake_size => pos_integer(), ssl_opts => list(), parser_opts => map(), idle_timeout => timeout(), close_timeout => timeout()}.