Skip to content
This repository has been 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

Open
robobakery opened this issue Jan 25, 2018 · 1 comment

Comments

@robobakery
Copy link

robobakery commented Jan 25, 2018

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)
@hawkfx
Copy link

hawkfx commented Jun 12, 2018

I'm having same issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants