mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 10:53:24 +00:00
Add detailed ICE candidate exchange logging
Added comprehensive logging to track WebRTC ICE candidate exchange: - Log local candidate generation with type (host/srflx/relay) - Log when candidates are sent to signaling server - Log remote candidate reception and addition - Log ICE gathering state changes - Log ICE connection state changes - Enhanced ICE error logging with details This will help diagnose connection issues and TURN server problems. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,12 +40,19 @@ export abstract class PeerState {
|
||||
if (event.candidate && this.peer.offerId) {
|
||||
const candidateData = event.candidate.toJSON();
|
||||
if (candidateData.candidate && candidateData.candidate !== '') {
|
||||
const type = candidateData.candidate.includes('typ host') ? 'host' :
|
||||
candidateData.candidate.includes('typ srflx') ? 'srflx' :
|
||||
candidateData.candidate.includes('typ relay') ? 'relay' : 'unknown';
|
||||
console.log(`🧊 Generated ${type} ICE candidate:`, candidateData.candidate);
|
||||
try {
|
||||
await this.peer.offersApi.addIceCandidates(this.peer.offerId, [candidateData]);
|
||||
console.log(`✅ Sent ${type} ICE candidate to server`);
|
||||
} catch (err) {
|
||||
console.error('Error sending ICE candidate:', err);
|
||||
console.error(`❌ Error sending ${type} ICE candidate:`, err);
|
||||
}
|
||||
}
|
||||
} else if (!event.candidate) {
|
||||
console.log('🧊 ICE gathering complete (null candidate)');
|
||||
}
|
||||
};
|
||||
this.peer.pc.addEventListener('icecandidate', this.iceCandidateHandler);
|
||||
|
||||
Reference in New Issue
Block a user