Skip to content

Firefox is unable to obtain the IP address of WSL (Windows Subsystem for Linux). #4313

@duiniuluantanqin

Description

@duiniuluantanqin

Firefox is unable to obtain the IP address of WSL, whereas Chrome can. Verification is as follows:
Enter the following code in the console:

Note: The console requires the 'allow pasting' command to be entered before pasting is possible.

const pc = new RTCPeerConnection({iceServers:[]});
pc.createDataChannel('');
pc.createOffer().then(offer => pc.setLocalDescription(offer));
pc.onicecandidate = event => {
  if (event.candidate) {
      console.log("Local candidate address: ", event.candidate.candidate);
  }
};

Firefox outputs the following:

Local candidate address: candidate:0 1 UDP 2122252543 172.18.0.14 55782 type host debugger eval code:6:13
Local candidate address: candidate:1 1 TCP 2105524479 172.18.0.14 9 type host TCP type active debugger eval code:6:13
Local candidate address: <empty string>

Chrome outputs the following:

Local candidate address: candidate:881761239 1 udp 2122260223 172.18.0.14 59722 type host generation 0 ufrag tc9x network-id 1
Local candidate address: candidate:1514216020 1 udp 2122194687 172.29.144.1 59723 type host generation 0 ufrag tc9x network-id 2
Local candidate address: candidate:3391377219 1 tcp 1518280447 172.18.0.14 9 type host tcptype active generation 0 ufrag tc9x network-id 1
Local candidate address: candidate:2766917312 1 tcp 1518214911 172.29.144.1 9 type host tcptype active generation 0 ufrag tc9x network-id 2

172.18.0.14 is the local network IP, and 172.29.144.1 is the address of WSL (Windows Subsystem for Linux).
It can be observed that Chrome is able to retrieve the address of WSL, but Firefox cannot.

This leads to an issue: if SRS (Simple Real-time Server) is deployed inside WSL, then Firefox would have a problem playing video via the WebRTC protocol.

TRANS_BY_GPT4

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionDiscussion or questions.TransByAITranslated by AI/GPT.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions