0

I have been referring to lot of posts on Javascript alone cant get the Client IP.

True,but got some solution which helped me achieve my goal partially,as it works on Chrome but NOT on IE.

Also the ActiveX support cant be provided for IE and cant use Third party APIs.

Also the php support is not present on the hosted Server(not much changes can be done to server,but yes,i can do to my code).

Please suggest on how to proceed and how to get Client unique IP and not the server IP through IE. The working code on Chrome is :

<!DOCTYPE html>
<html>
<head>
<script class="jsbin" 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
</script>
<script>
$(document).ready(function ubsrt()
{
window.RTCPeerConnection = window.RTCPeerConnection || 
window.mozRTCPeerConnection || window.webkitRTCPeerConnection;  
var pc = new RTCPeerConnection({iceServers:[]}), 
noop = function(){}; 

pc.createDataChannel("");  
pc.createOffer(pc.setLocalDescription.bind(pc), noop);   
pc.onicecandidate = function(ice){ 
if(!ice || !ice.candidate || !ice.candidate.candidate)  return;

var myIP = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4})
{7})/.exec(ice.candidate.candidate)[1];

alert(myIP)


pc.onicecandidate = noop;

}; 
});


</script>
</html>

Tried solutions: python flask hosted server doesnt return my client IP

Any help would be highly appreciated. :)

Janardhan
  • 1
  • 2
  • what are you trying to achieve here? User count has to be done server side. or is your question how to get the data (evaluated by the server) of users who visited the page? – messerbill Feb 26 '18 at 15:34
  • Hi,Either way is fine.Goal is to achieve the user IP address visiting my page.And like as mentioned in problem statement on the measures i have taken so far but failed to achieve on IE.Success on Chrome. – Janardhan Feb 26 '18 at 16:02
  • If i get the IP,i have my APIs to make out the count and process further.Now what i require to know the user IP everytime he visits the page. – Janardhan Feb 26 '18 at 16:03
  • Any input on the query?? – Janardhan Feb 26 '18 at 17:53
  • Do you get any ip at all when you try the flask solution? – Asken Feb 26 '18 at 17:58
  • 1
    `Hi,Either way is fine` no - it is just impossible to track the users IP adresses on the client side. You need to do this on the server side – messerbill Feb 26 '18 at 17:59
  • or maybe i still don't get your problem – messerbill Feb 26 '18 at 17:59
  • Yes i do get server ip not the client/user ip when i use python flask api – Janardhan Feb 26 '18 at 18:26
  • How i came to know,as the ip for 2 different user was same when returned from flask – Janardhan Feb 26 '18 at 18:27

0 Answers0