WebSockets
Build real-time apps on Conduit using WebSocket subscriptions.
Effective August 4, 2026 at 12:00 PM PST: WebSocket connections require an authenticated Conduit account — append an API key to your WSS URL. Anonymous connections are rejected. If you already connect with an API key, nothing changes on August 4. Integrations using WebSocket without a key will stop working until you create a free key and append it to the WSS URL.
Quick start: connect to Conduit WebSockets
Open a connection using the WSS URL from your Nodes dashboard. The URL is shown next to each API key and may include a path segment. Use that exact value. An API key is required — append it to the WSS URL as shown below.
Example using wscat:
To create or manage keys, see Get an API key.
What are WebSockets?
WebSockets is a bidirectional protocol that keeps a persistent connection between a client and a server. Unlike HTTP, clients don’t need to poll for updates. With an open WebSocket connection, the server can push network updates to subscribed clients (for example, when new blocks are produced or matching logs are found).
When to use HTTP instead of WebSockets
Use HTTPS for standard JSON-RPC requests (eth_call, eth_getBlockByNumber, eth_sendRawTransaction). Reserve WebSockets for push-style subscriptions.
Why HTTP is often better for requests:
- Reliability and error signals: HTTP provides status codes and mature retry tooling; WebSockets can fail silently without careful client handling
- Load balancing: Each HTTP request is routed to the healthiest backend; a long-lived WebSocket stays on one node
- Retries and backoff: HTTP clients commonly support automatic retries and backoff; WebSocket JSON-RPC requires custom id tracking and reconnect logic
- Compression: HTTP compression can reduce bandwidth for large payloads
Subscriptions: real-time updates
After connecting, use standard Ethereum JSON-RPC methods to manage subscriptions:
eth_subscribeeth_unsubscribe
Examples
Subscribe to new heads:
Subscribe to logs for an address and topic:
Unsubscribe:
Connection management
- Use exponential backoff with jitter when reconnecting and resubscribing
- Send application-level heartbeats if your client or environment doesn’t automatically respond to ping/pong
- Deduplicate messages by block number or transaction hash when reconnecting
- Limit the number of concurrent subscriptions per connection; scope filters narrowly
Limits and throughput
- WebSocket traffic counts toward your organization’s throughput. See Throughput
- Avoid very large subscription result sets; filter by
addressandtopics - If the connection is idle for an extended period, servers may close it. Reconnect with backoff
Connection and subscription limits
Per-plan WebSocket session limits take effect later this quarter:
These limits are set well above what most customers use today. If you already connect with an API key, your existing traffic patterns are unlikely to be affected.
Best practices checklist
- Keep one WebSocket per service; avoid opening many connections
- Scope subscriptions narrowly (filter by
addressandtopics) - Reconnect with exponential backoff and jitter; resubscribe on reconnect
- Implement heartbeats or respond to ping/pong
- Fall back to HTTP for historical scans and catch-up reads