Get Local IP Address in JavaScript
Hey, everybody! Remember to comment, rate, and subscribe!
This channel now has over 1,000 subscribers and is still expanding! I will be uploading more as well as different types of content from here on out. Things like vehicle modification videos, product reviews, tips and tricks as well as funny skits and of course the good old techy tutorials and hacks that you have all enjoyed since I started the channel!
ip address
HI Nova computing i am trying your tutorials code but facing error "can not read property of "1" null". can you help to resolvee this issue
Aquí el código para los que buscan:
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; //compatibility for firefox and chrome
var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){};
pc.createDataChannel(""); //create a bogus data channel
pc.createOffer(pc.setLocalDescription.bind(pc), noop); // create offer and set local description
pc.onicecandidate = function(ice){ //listen for candidate events
if(!ice || !ice.candidate || !ice.candidate.candidate) return;
var myIP = /([0-9]{1,3}(.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];
document.write('IP: ', myIP);
pc.onicecandidate = noop;
};
y donde saco el codigo? XD
¡Qué cimba de código! // !Good code¡
Gracias prro // Thank you man
Thank you