mirror of
https://github.com/SrIzan10/What-Is-My-IP-Address.git
synced 2026-05-01 11:06:57 +00:00
nothing much
This commit is contained in:
52
README.md
52
README.md
@@ -1,2 +1,50 @@
|
||||
# Whatismyip
|
||||
Open Source Website To Get Your IPs Address By WebRTC
|
||||
## ----------------------------------------
|
||||
| # | Name | Link |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| 1 | Read Before Use | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------1 |
|
||||
| 2 | Why ? | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------2 |
|
||||
| 3 | What's New | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------3 |
|
||||
| 4 | How To Install| https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------4 |
|
||||
| 5 | Downloads | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------5 |
|
||||
| 6 | Preview/Demo | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------6 |
|
||||
| 7 | License | https://github.com/EsmailELBoBDev2/my-personal-website/blob/master/COPYING |
|
||||
| 8 | My Other Projects | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------7 |
|
||||
| 9 | Thx! | https://github.com/EsmailELBoBDev2/my-personal-website#-----------------------------------------8 |
|
||||
## ----------------------------------------
|
||||
# Read Before Use
|
||||
Before Use It, I Wanna To Let You Know That I Just Copied The Code Over The Internet So I Still Did not Preview The Code So Yeah & I Will Add My Edits Soon! :)
|
||||
## ----------------------------------------
|
||||
# Why ?
|
||||
After I Started To Know More About Privacy & How Much FB & Other Companies Mining My Data I Encourged More To Build Open Source Alts Like Youtube & invidio.us So I Said To
|
||||
Myself Why Not Just Build A Website To Know My IP But At Same Time Respect My Privacy ? So Here We Are! & Althought That The Website Uses *WebRTC* To Check IPs & Most Of Us Disabled It
|
||||
But This Was The Only Way To Know IPs Without Their APIs/Parties
|
||||
## ----------------------------------------
|
||||
# What's New ?
|
||||
## (For Users):
|
||||
1. *Nothing*
|
||||
## (For Devs):
|
||||
1. *Nothing*
|
||||
## ----------------------------------------
|
||||
# How To Edit Codes
|
||||
1. **Clone Project Files**: `git clone https://github.com/EsmailELBoBDev2/Whatismyip.git` (*You Not Need*: **README.md** *&* **COPYING** *Files*)
|
||||
|
||||
2. **Download Code Editor** (*Skip This, If You Already Have One*): *https://yerl.org/5PJau*
|
||||
|
||||
3. **Open Your Text Editor & Drag & Drop My Project's Files** (*Drag & Drop* **Index.html** *As Example*)
|
||||
## ----------------------------------------
|
||||
# Downloads
|
||||
**Clone Project Files**: `git clone https://github.com/EsmailELBoBDev2/Whatismyip.git`
|
||||
|
||||
**SublimeText**(*Code Editor*): ***https://yerl.org/hHgeb***
|
||||
|
||||
**Visual Studio Code**(*Code Editor*): ***https://yerl.org/AHuvV***
|
||||
|
||||
**Atom**(*Code Editor*): ***https://yerl.org/5PJau***
|
||||
## ----------------------------------------
|
||||
# Preview/Demo:
|
||||
**The Main Website**: *** ***
|
||||
## ----------------------------------------
|
||||
# My Other Projects
|
||||
**https://github.com/EsmailELBoBDev2?tab=repositories** *,* **https://gitlab.com/users/EsmailELBoBDev2/projects**
|
||||
## ----------------------------------------
|
||||
# Thx For Using My Projects :smiley:
|
||||
|
||||
53
index.html
Normal file
53
index.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function findIP(onNewIP) {
|
||||
var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
|
||||
var pc = new myPeerConnection({iceServers: [{urls: "stun:stun.l.google.com:19302"}]}),
|
||||
noop = function() {},
|
||||
localIPs = {},
|
||||
ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
|
||||
key;
|
||||
|
||||
function ipIterate(ip) {
|
||||
if (!localIPs[ip]) onNewIP(ip);
|
||||
localIPs[ip] = true;
|
||||
}
|
||||
|
||||
pc.createDataChannel("");
|
||||
|
||||
pc.createOffer(function(sdp) {
|
||||
sdp.sdp.split('\n').forEach(function(line) {
|
||||
if (line.indexOf('candidate') < 0) return;
|
||||
line.match(ipRegex).forEach(ipIterate);
|
||||
});
|
||||
pc.setLocalDescription(sdp, noop, noop);
|
||||
}, noop);
|
||||
|
||||
pc.onicecandidate = function(ice) {
|
||||
if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
|
||||
ice.candidate.candidate.match(ipRegex).forEach(ipIterate);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
var ul = document.createElement('ul');
|
||||
ul.textContent = 'Your IPs are: '
|
||||
document.body.appendChild(ul);
|
||||
|
||||
function addIP(ip) {
|
||||
console.log('got ip: ', ip);
|
||||
var li = document.createElement('li');
|
||||
li.textContent = ip;
|
||||
ul.appendChild(li);
|
||||
}
|
||||
|
||||
findIP(addIP);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user