proxy: webRTCconn gives the remote IP instead of the Address

We only use the IP part of the address.
This commit is contained in:
meskio 2025-02-04 11:48:04 +01:00
parent 57eefd4b37
commit b3c734ed63
No known key found for this signature in database
GPG key ID: 52B8F5AC97A2DA86
2 changed files with 11 additions and 16 deletions

View file

@ -113,13 +113,9 @@ func (c *webRTCConn) LocalAddr() net.Addr {
return nil
}
func (c *webRTCConn) RemoteAddr() net.Addr {
func (c *webRTCConn) RemoteIP() net.IP {
//Parse Remote SDP offer and extract client IP
clientIP := remoteIPFromSDP(c.pc.RemoteDescription().SDP)
if clientIP == nil {
return nil
}
return &net.IPAddr{IP: clientIP, Zone: ""}
return remoteIPFromSDP(c.pc.RemoteDescription().SDP)
}
func (c *webRTCConn) SetDeadline(t time.Time) error {