sipsorcery icon indicating copy to clipboard operation
sipsorcery copied to clipboard

Using Proxy

Open KishanDasani opened this issue 1 year ago • 2 comments

I am using SIPSorcery for my use case with webRTC. currently, using the configuration for stun and turn URL like this.

private RTCPeerConnection _peerConnection;
RTCConfiguration config = new RTCConfiguration
{
    iceServers = new List<RTCIceServer> {
        new RTCIceServer { urls = "stunUrl" },
        new RTCIceServer
        {
            urls = "turnUrl",
            username = "turnUserName",
            credential = "turnPassword"
        }
    }
};
_peerConnection = new RTCPeerConnection(config);

this is working properly when there's no proxy is configured in the system. after configuring proxy (HTTP and HTTPS), state is never changing to "Connected", always getting to "failed" and then "disconnected" state.

Is there any way to give proxy configuration with this setup?

KishanDasani avatar Sep 02 '24 09:09 KishanDasani

Depending on the type of proxy you use, it may or may not support UDP.

HTTP/S Proxies use TCP and SIPSorcery doesn't support TCP. (yet, and probably not anytime soon)

The WebRTC specification laid out the use of proxies but does not recommend using TCP proxies.

If this is at the organizational level (business/corporate/enterprise), it might be better to configure it at the network level. (firewall/VPN/routing)

ha-ves avatar Sep 02 '24 09:09 ha-ves

@KishanDasani: Do you use any VPNs/firewalls that block the normal communications (non-proxied)? I am pretty sure that SipSorcery won't do TCP TURN but I am not sure if it's the STUN ones getting bounced as STUN can also use TCP (?protocol=tcp), I am not sure whether SipSorcery can use it. It could also be that the DNS requests getting blocked because TCP DNS is getting proxied/blocked somehow.

ris-work avatar Oct 02 '24 11:10 ris-work

If there's any further info please feel free to re-open this issue.

sipsorcery avatar Oct 27 '24 23:10 sipsorcery