test new ip method using webrtc

This commit is contained in:
Boof 2023-01-11 10:49:14 +01:00 committed by GitHub
parent 7dfdc2a357
commit 085fc97437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@
<link rel="icon" type="image/x-icon" href="data/images/logoround.png">
<link rel="stylesheet" href="data/style.css">
<script src="index.js" defer></script>
<script src="https://cdn.jsdelivr.net/gh/joeymalvinni/webrtc-ip/dist/bundle.dev.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>

View File

@ -27,7 +27,10 @@ document.querySelector('.current-year').innerText = year;
//Get user ip to put it in the contact form
//Also check if they are using a vpn
$.getJSON("https://europe-central2-portfolio-website-374313.cloudfunctions.net/getip", function(data) {
//$.getJSON("https://europe-central2-portfolio-website-374313.cloudfunctions.net/getip", function(data) {
getIPs().then(data=>{
console.log(data.ip)
console.log(data.join)
var userip = (data.ip);
document.getElementById("formip").value = (data.ip);
fetch('vpnip.txt')