To prevent host (private) IP leakage, you can use the WebRTC APIs to control the ICE candidates. More specifically, you can take advantage of the `
RTCPeerConnection` API's `
iceTransportPolicy` setting. By setting it to "
relay", the API will only gather Server Reflexive (
srflx) and Relay candidates (those from your TURN server), effectively bypassing the gathering of host candidates.
Yes, you can modify the
iceTransportPolicy in the
clientConfig of the
cirrus.js file in Pixel Streaming's
WebSignalingServer.
Here's how you can do it:
```
var clientConfig = {
type: 'config',
peerConnectionOptions: {
'iceServers': [
{
'urls': 'turn:YourTurnServer',
'username': 'TurnServerUsername',
'credential': 'TurnServerPassword'
}
],
'iceTransportPolicy': 'relay' // Only use Relay ICE candidates
}
};
```
Replace 'YourTurnServer', 'TurnServerUsername', and 'TurnServerPassword' with your TURN server details.
This will restrict WebRTC to only use your TURN server, mitigating the risk of exposing your private IP address. Just remember that this may affect connection times and reliability if your TURN server is not highly available.
Thanks