Skip to content

Instantly share code, notes, and snippets.

@rndme
Created February 26, 2019 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rndme/6df3f26183db5bb2ddc877b7b688279c to your computer and use it in GitHub Desktop.
Save rndme/6df3f26183db5bb2ddc877b7b688279c to your computer and use it in GitHub Desktop.
function ip(cb) {
with(new RTCPeerConnection) {
createDataChannel(0);
createOffer(e=> setLocalDescription(e), Date);
onicecandidate =e=>{if(e=e.candidate) cb(e.candidate.split(/\s+/)[4])};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment