Last active
April 30, 2024 16:15
-
-
Save ukcoderj/f8b6fc86c15a4727f737a75bc1bf43b2 to your computer and use it in GitHub Desktop.
Get client ip address from html page without going to an external website.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>IP Address</title> | |
<meta name="description" content="The HTML5 Herald"> | |
<meta name="author" content="SitePoint"> | |
<link rel="stylesheet" href="css/styles.css?v=1.0"> | |
<script> | |
var findIP = new Promise(r=>{var w=window,a=new (w.RTCPeerConnection||w.mozRTCPeerConnection||w.webkitRTCPeerConnection)({iceServers:[]}),b=()=>{};a.createDataChannel("");a.createOffer(c=>a.setLocalDescription(c,b,b),b);a.onicecandidate=c=>{try{c.candidate.candidate.match(/([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g).forEach(r)}catch(e){}}}) | |
/*Usage example*/ | |
findIP.then(ip => document.write('your ip: ', ip)).catch(e => console.error(e)) | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
i want to send this file to my friend. how can i get his ip system in my pc? pls help me
You can grab his IP and then just use a discord webhook or something so that the discord webhook will send his IP as a message
i want to send this file to my friend. how can i get his ip system in my pc? pls help me
You can grab his IP and then just use a discord webhook or something so that the discord webhook will send his IP as a message
sir, i want to find my friend's IP :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i want to send this file to my friend. how can i get his ip system in my pc? pls help me