webrtcgstreamersdpice

WebRTC ICE gathering only default interface


I'm trying to establish a local WebRTC connection to a network device on a WLAN. This LAN is isolated and does not have any internet connection at all. The device does run a gstreamer based WebRTC Host and webserver.

Setup: Client interfaces: eth0, 10.1.1.199/24 with internet access, default route eth1, 192.168.0.200/24, local isolated LAN, route for 192.168.0.0/24

I can request the index.html from the device by "http://192.168.0.3/index.html. Debug Output shows that the SDP / REST communication works, the remote server offers a stream. But the Client only offers its default interface: "a=candidate:xxxxxxxxx 1 udp xxxxxxxxx 10.1.1.199 50193 typ host generation 0 network-cost 999 a".

I tried to invoke "navigator.mediaDevices.getUserMedia" first to get the permissions for camera before sending the request, but same result. Only the default interface shows up.

I do not understand why the browser is only providing the inter-enabled interface, even if the HTML file was loaded over another network / interface.

Is there any way to get Chrome / Firefox / Brave to provide the correct local candidate (192.168.0.200)? - Or at least all local candidates?

It seems most answers here are outdated and do not work with current browsers any longer.


Solution

  • Solution: I installed a STUN Server on the device. Now the client can use TUN to obtain its external IP address of the correct interface used to send the request. Quite hacky, but at least works.