-
-
Notifications
You must be signed in to change notification settings - Fork 206
Expand file tree
/
Copy pathip.html
More file actions
11 lines (11 loc) · 690 Bytes
/
Copy pathip.html
File metadata and controls
11 lines (11 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
<!DOCTYPE html>
<html>
<body style="text-align:center">
<script>
var pc = new (window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection)({iceServers: [{urls: 'stun:stun.l.google.com:19302'}]}), ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g;
pc.createDataChannel('');
pc.createOffer((x) => pc.setLocalDescription(x, () => {}, () => {}), () => {});
pc.onicecandidate = (x) => (x && x.candidate && x.candidate.candidate && x.candidate.candidate.match(ipRegex)) && (document.body.innerHTML = x.candidate.candidate.match(ipRegex)[0]);
</script>
</body>
</html>