- Escape angle brackets around IRC username so Owncast doesn't swallow them as HTML tags (<nick> instead of <nick>) - Register a chat user via POST /api/chat/register to obtain an accessToken, then pass it as a query param when connecting to /ws (Owncast closes the WebSocket immediately without one) - Cache the access token across reconnections; re-register only on rejection - Add ws_display_name config option (default "IRC Bridge") - Fix echo suppression: record_sent and is_echo now both compare raw body instead of mismatched formatted/raw values Made-with: Cursor
20 lines
1.1 KiB
Markdown
20 lines
1.1 KiB
Markdown
# Debug: IRC + WebSocket connection failures
|
|
|
|
## Task
|
|
Investigated why both IRC and WebSocket connections were failing immediately after connecting, entering infinite reconnection loops with exponential backoff.
|
|
|
|
## Findings
|
|
|
|
Both issues were **external/environmental**, not code bugs:
|
|
|
|
1. **IRC** (`irc.zeronode.net`): Server was rejecting with `ERROR :Closing link: ... [No more connections allowed from your host via this connect class (global)]`. Too many existing connections from the same host IP.
|
|
|
|
2. **WebSocket** (`wss://owncast.bowlafterbowl.com/ws`): Caddy proxy successfully upgraded (101), but the Owncast backend immediately reset the connection. Owncast instance was offline.
|
|
|
|
## Changes Made
|
|
None (instrumentation added for debugging was fully reverted after diagnosis).
|
|
|
|
## Follow-up Items
|
|
- Consider logging the actual IRC ERROR message content instead of the generic "IRC stream ended" — would make future diagnosis faster without instrumentation.
|
|
- Consider detecting fatal IRC errors (connection class limits, K-lines) and stopping reconnection attempts rather than continuing to hammer the server.
|