Problem
Currently whisper connects to a single relay. If that relay is down or slow, the operation fails.
Solution
Accept multiple relay URLs and publish/subscribe to all of them.
Send behavior
- Publish to all relays in parallel
- Success if any relay accepts
- Report which relays succeeded/failed in verbose mode
Recv behavior
- Subscribe to all relays
- Deduplicate incoming messages by event ID
- Graceful handling when relays disconnect
Interface
# Multiple --relay flags
whisper send --relay wss://relay1.example --relay wss://relay2.example ...
# Or comma-separated
whisper send --relays wss://relay1.example,wss://relay2.example ...
# Environment variable
export NOSTR_RELAYS="wss://relay1.example,wss://relay2.example"
Implementation Notes
- Use libwebsockets multi-connection support
- Track event IDs in a small hash set for dedup (recv)
- First-success-wins for send, all-parallel for recv
Problem
Currently whisper connects to a single relay. If that relay is down or slow, the operation fails.
Solution
Accept multiple relay URLs and publish/subscribe to all of them.
Send behavior
Recv behavior
Interface
Implementation Notes