OffBroadwayWebSocket.Client (off_broadway_websocket v0.0.4)
Provides functions to establish and configure WebSocket connections using the gun library, with customizable timeouts and connection options.
Summary
Functions
Establishes a WebSocket connection to the specified URL and path with optional gun options, and customizable timeouts.
Functions
@spec connect( String.t(), String.t(), {map() | nil, map() | nil}, non_neg_integer(), non_neg_integer() ) :: {:ok, map()} | {:error, term()}
Establishes a WebSocket connection to the specified URL and path with optional gun options, and customizable timeouts.
Parameters
- url: The base URL for the WebSocket connection (e.g., "wss://example.com").
- path: The WebSocket path to upgrade to (e.g., "/ws").
- gun_opts: A tuple {http_opts, ws_opts} containing optional configurations for HTTP and WebSocket settings. Either http_opts or ws_opts may be nil.
- await_timeout: The timeout in milliseconds to wait for the connection to become ready.
- connect_timeout: The timeout in milliseconds for establishing the connection.
Returns
- } on a successful connection and upgrade.
- if the connection or upgrade fails.