diff --git a/client/internal/peer/conn.go b/client/internal/peer/conn.go index 56b772759a..e60089cb65 100644 --- a/client/internal/peer/conn.go +++ b/client/internal/peer/conn.go @@ -333,6 +333,7 @@ func (conn *Conn) iCEConnectionIsReady(priority ConnPriority, iceConnInfo ICECon ep = wgProxy.EndpointAddr() conn.wgProxyICE = wgProxy } else { + log.Infof("direct iceConnInfo: %v", iceConnInfo.RemoteConn) directEp, err := net.ResolveUDPAddr("udp", iceConnInfo.RemoteConn.RemoteAddr().String()) if err != nil { log.Errorf("failed to resolveUDPaddr") diff --git a/client/internal/peer/worker_ice.go b/client/internal/peer/worker_ice.go index 55894218d7..674fef4697 100644 --- a/client/internal/peer/worker_ice.go +++ b/client/internal/peer/worker_ice.go @@ -126,6 +126,8 @@ func (w *WorkerICE) OnNewOffer(remoteOfferAnswer *OfferAnswer) { w.log.Debugf("failed to dial the remote peer: %s", err) return } + w.log.Infof("check remoteConn: %v", remoteConn) + w.log.Infof("check remoteConn.RemoteAddr: %v", remoteConn.RemoteAddr()) w.log.Debugf("agent dial succeeded") pair, err := w.agent.GetSelectedCandidatePair() @@ -322,8 +324,10 @@ func (w *WorkerICE) shouldSendExtraSrflxCandidate(candidate ice.Candidate) bool func (w *WorkerICE) turnAgentDial(ctx context.Context, remoteOfferAnswer *OfferAnswer) (*ice.Conn, error) { isControlling := w.config.LocalKey > w.config.Key if isControlling { + w.log.Infof("dialing remote peer %s as controlling", w.config.Key) return w.agent.Dial(ctx, remoteOfferAnswer.IceCredentials.UFrag, remoteOfferAnswer.IceCredentials.Pwd) } else { + w.log.Infof("dialing remote peer %s as controlled", w.config.Key) return w.agent.Accept(ctx, remoteOfferAnswer.IceCredentials.UFrag, remoteOfferAnswer.IceCredentials.Pwd) } }