ZenWebsocket.Examples.Docs.BasicUsage (ZenWebsocket v0.4.2)

Copy Markdown View Source

Basic usage examples from the documentation. These examples demonstrate simple WebSocket connections and message handling.

Summary

Functions

Connection with custom headers example.

Simple Deribit testnet connection example.

Functions

custom_headers_example(token)

@spec custom_headers_example(String.t()) :: {:ok, ZenWebsocket.Client.t()}

Connection with custom headers example.

Shows how to connect with authorization headers and other custom headers.

deribit_testnet_example()

@spec deribit_testnet_example() :: {:ok, ZenWebsocket.Client.t()}

Simple Deribit testnet connection example.

Connects to Deribit testnet, sends a public API request, and receives response. The default handler automatically sends messages to the calling process.