Make getIP client side
Description
Make getIP client side (js) instead of server side. Or have the possibility to choose which side to use.
Why it should be implemented
Our speedtest is hosted inside a VPN. We use it to test client-to-server tunnel. So every client source IP is a private address. Having the possibility to do it client side will give us the public IP of the client and so being able to know which ISP it is using. Also, our speedtest host don't have access to Internet, just local network, so current getIP is unable to reach ipinfo.io.
Thanks!
That's an interesting concept, I'm not sure if ipinfo allows it since it's technically bypassing the API key requirement, I'll have to investigate it and do some tests.
I tried inserting this in index.html and it gets my public source IP:
<script>
function getSourceIP(json) {
alert("My public IP address is: " + json.ip);
}
</script>
<script src="https://api.ipify.org?format=jsonp&callback=getSourceIP"></script>
But I have no idea how to do the rest
If this gets implemented it should definitely be opt-in. Not everyone wants to connect to a third party site.
See my #436 . Does your proxy have a header like "forward for"?
See my #436 . Does your proxy have a header like "forward for"?
Yes it does. But it returns a private address since I'm connected to the VPN
Wait, there's something I didn't get. Do you mean the server is behind a proxy or the client is using vpn?
In case 1, forward-for is enough.
In case 2, there should be no (normal) way to get real client IP. That's why people use a vpn. They want to hide their ip. See ipleak.net for more details.
Or you mean, the server is in your organization and it is in a VPN, you need to know the quality of the vpn connection.
In that case you may need to use location API instead of getting an ip and calculate the distance.
Or you mean, the server is in your organization and it is in a VPN, you need to know the quality of the vpn connection. In that case you may need to use
location APIinstead of getting an ip and calculate the distance.
That's why I want to get the public IP from the client side I'll see if I can make some sense from that locationAPI
The fact is that you can't (?) get the client IP (without a server)