Skip to content

Commit 3077f0a

Browse files
committed
Fix ICE candidate parsing for 8-part candidates
- Update validation from len(parts) >= 10 to len(parts) >= 8 - Add support for standard RFC 5245 ICE candidates - Include real examples and RFC compliance in comments - Tested with actual host candidates: candidate:0 1 UDP 2122187007 192.168.1.52 38846 typ host
1 parent 27f0549 commit 3077f0a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backend/fastrtc/webrtc_connection_mixin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ async def handle_offer(self, body, set_outputs):
245245
candidate_str = body["candidate"].get("candidate", "")
246246

247247
# Example format: "candidate:2393089663 1 udp 2122260223 192.168.86.60 63692 typ host generation 0 ufrag LkZb network-id 1 network-cost 10"
248+
# Also support shorter format: "candidate:0 1 UDP 2122187007 192.168.1.52 38846 typ host"
248249
parts = candidate_str.split()
249-
if len(parts) >= 10 and parts[0].startswith("candidate:"):
250+
if len(parts) >= 8 and parts[0].startswith("candidate:"):
250251
foundation = parts[0].split(":", 1)[1]
251252
component = int(parts[1])
252253
protocol = parts[2]

0 commit comments

Comments
 (0)