feat: emit peer_status (ICE state + candidate type) from daemon
Hooks pc.OnConnectionStateChange in WireDataChannel to emit peer_status events. On connected, calls pc.GetStats() to find the nominated candidate pair and report candidateType (host/srflx/relay) and remote address. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -228,6 +228,7 @@ const (
|
||||
EvtPeerConnected IpcMsgType = "peer_connected"
|
||||
EvtPeerDisconnected IpcMsgType = "peer_disconnected"
|
||||
EvtSessionReady IpcMsgType = "session_ready" // DataChannel open + hello verified
|
||||
EvtPeerStatus IpcMsgType = "peer_status" // ICE connection state + candidate type
|
||||
EvtIncomingFile IpcMsgType = "incoming_file"
|
||||
EvtFileProgress IpcMsgType = "file_progress"
|
||||
EvtStateSnapshot IpcMsgType = "state_snapshot"
|
||||
@@ -294,4 +295,8 @@ type IpcMessage struct {
|
||||
// export_identity / import_identity
|
||||
Passphrase string `json:"passphrase,omitempty"` // import only; never echoed back
|
||||
Backup string `json:"backup,omitempty"` // JSON backup blob
|
||||
// peer_status — ICE connection quality
|
||||
ConnState string `json:"conn_state,omitempty"` // pion PeerConnectionState string
|
||||
CandidateType string `json:"candidate_type,omitempty"` // host | srflx | relay | unknown
|
||||
RemoteAddress string `json:"remote_address,omitempty"` // remote IP:port of active candidate pair
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user