Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.
This repository was archived by the owner on May 18, 2020. It is now read-only.

imprint.test() never resolves on safari when "localIp" option is included. #2

@robobakery

Description

@robobakery

Hello, I would like to report an issue with safari browser.
imprint.test() never resolves on safari when "localIp" option is included.

if I remove "localIp" option from tests array, it worked well.

Insted of listening for candidate events,
I've tried inspecting pc.localDescription after a delay.
somehow it worked (succeeded to get an IP),
but I am not sure what's going on with original code.

so I attached my code below, and I hope it helps.
thank you.

var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var re = /c=IN IP4 ([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/;

var localIpTest = new Promise(function(resolve) {
	var pc = new RTCPeerConnection({iceServers:[]});
	var noop = function(){};
	pc.createDataChannel("");
	pc.createOffer(result => pc.setLocalDescription(result, noop, noop), noop);

  setTimeout(() => {
    resolve(re.exec(pc.localDescription.sdp)[1]);
  }, 550);
});

test devices

mobile: webview, in app browser, safari / pc: safari

  • physical device (iphone 6s):
  • virtual device (iphone 6)
  • macbook pro retina 13 (macOS high sierra)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions