Skip to content

feat: Add trickle ICE support (client -> server)#121

Open
Object905 wants to merge 2 commits into
miuda-ai:mainfrom
Object905:pr_trickle
Open

feat: Add trickle ICE support (client -> server)#121
Object905 wants to merge 2 commits into
miuda-ai:mainfrom
Object905:pr_trickle

Conversation

@Object905

Copy link
Copy Markdown
Contributor

Summary

  • Adds AddIceCandidate WebSocket command, letting a WebRTC caller send its offer immediately (without waiting for full ICE gathering) and stream candidates in as they're found.
  • New Track::add_ice_candidate trait method (default no-op), implemented on RtcTrack via rustrtc's existing PeerConnection::add_ice_candidate.
  • Server-side answer behavior is unchanged — still waits for full gathering before answering (server-side gathering is fast; not worth streaming out). This is client → server trickle only, no new event/no protocol negotiation needed.

Why

WebRTC callers behind NAT/restrictive networks can have slow ICE gathering, which currently blocks sending the offer at all. This lets the offer go out immediately and trickle candidates in afterward, cutting call-setup latency without touching server-side answer timing.

Lets a WebRTC caller send its offer immediately, without waiting for
full ICE gathering, and stream candidates in via the new
addIceCandidate command as they're found. Server-side answer behavior
is unchanged (still waits for full gathering before answering).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Object905

Object905 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Don't know for sure - but this requires buffering candidates on "frontend" before offer/answer and then flushing. Not a great UX.
I think this should be extended to gather AddIceCandidate into buffer and apply them when possible.
Changed to WIP for now.

@Object905 Object905 changed the title Add trickle ICE support (client -> server) WIP: Add trickle ICE support (client -> server) Jul 20, 2026
@Object905 Object905 changed the title WIP: Add trickle ICE support (client -> server) feat: Add trickle ICE support (client -> server) Jul 22, 2026
@Object905

Copy link
Copy Markdown
Contributor Author

Added buffering. Ready for review.

Not sure that this is correct "trickle" due to this commit: restsend/rustrtc@8af2420 is trickling supported in rustrtc? Is api the same pc.add_ice_candidate?

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