Skip to content

Keep quiet relay pairs up with pings on both sides - #62

Merged
enowdev merged 1 commit into
mainfrom
fix/relay-pair-keepalive
Nov 12, 2026
Merged

enowdev merged 1 commit into
mainfrom
fix/relay-pair-keepalive

Conversation

@enowdev

@enowdev enowdev commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Through Cloudflare, a member/host pair with no traffic was cut after about 125 s (Cloudflare's idle limit); only the host's own relay link had pings. A member watching a quiet terminal was dropped.

  • The relay pings both WebSocket legs of each pair every 30 s (RelayLimits.Ping), each leg on its own, and ends a pair whose leg doesn't answer. Chosen over encrypted no-op records from the endpoints: no protocol or client change, and pings carry nothing of the visit, so E2E is untouched.
  • Test: TestRelayQuietPairStaysUp puts a proxy that cuts connections idle for 500 ms in front of both the host and the member, keeps a pair quiet for 2 s, and echoes through it (fails without the fix).
  • docs/cloud.md says so; gofmt of cloud/relay/relay.go.

🤖 Generated with Claude Code

Through Cloudflare, a member and a host with nothing to say were cut
after about 100 seconds, so a member watching a quiet terminal was
dropped; only the host's own link had pings. The relay now pings both
sides of each pair every 30 seconds (RelayLimits.Ping), each side apart,
and ends a pair whose side doesn't answer. Pings carry nothing of the
visit, so its records stay sealed end to end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enowdev
enowdev merged commit 165cc5e into main Nov 12, 2026
4 checks passed
@enowdev enowdev mentioned this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant