How can I use webrtc offline

Solution 1:

The error gets thrown here in Firefox code: https://searchfox.org/mozilla-central/source/dom/media/PeerConnection.jsm#473

The workaround with the loopback interface no longer works if I read that code correct. The if condition in the code just asks the networking code if there is any network connectivity.

So you either

  • try Phillips suggestion of making one network interface believe it still has connectivity. Maybe a fake interface with a hard coded IP address, but no default route would be enough.
  • Or you convince the Mozilla developers that there are reasonable use cases for using PeerConnections in offline scenarios to drop that check in Firefox - although I would be concerned that it might run into another error further down in the code. Or you could try to submit a patch yourself.