Where I attempt to detect if you're on a VPN or running through a proxy!
{{status}}
This tool works on the concept that your latency to the server should be roughly equivalent to the servers latency to you. While there might be some slight variation, a connection from your computer to my server should take approximately as long to connect as a connection from my server to your computer (or router, as the case may be - wherever your public IP points to).
If you're behind a VPN or a proxy, my server will see their public IP instead of yours. What this means is that the latency for you computer to my server also includes the latency from your computer through the proxy to its public IP.
So the system is pretty simple - from your browser, I ping the server a bunch of times and get an average latency. I then send that to the server, which pings your public IP a bunch of times, to get its own average latency. I compare the two, and based on how much variation there is, decide if you're likely to be hiding behind a VPN or proxy.
I don't know. You tell me. It's just a theory, and as you can see running a bunch of pings takes some time. I'm also leveraging existing libraries for getting latency via javascript and PHP, because I wasn't interested in rolling my own. If you cared about performance, you could probably figure out a way to do it more efficiently.
In the current form, yes, however you could potentially use other connections that your app already has to make (i.e. loading data) to get an average connection speed/latency.
This idea also relies on the fact that it can ping your public IP - a lot of servers are configured to explicitly not respond to a ping, so it may fall over there, too.
Finally, a smart VPN or proxy might detect the calls and replace the average response time in the comparison call, but if your VPN or proxy is actively editing your requests... maybe it's not that good for security.
Also very possible just due to local network infrastructure. If your connection through your router adds 20-30ms to your latency, then that could show up as possible VPN usage. However, if your network infrastructure does do this, maybe it's time to buy a new router.
It's also possible that random fluctuations in the networking gear on the server end could cause false positives, or even just a heavy load on the server could cause it to have random slow-downs that are interpreted as a latency issue despite actually just being a slow processing/response time.
Sure. It's available on github at samlev/vpn-detect. For this version, the grunt work is being done by network.js and on the server Ping for PHP. Again, there's probably much more reliable and efficient ways of achieving this, but I just wanted to test if the concept would even work at all.
I wouldn't suggest using this in production anywhere, but it's just an experiment to see if you can detect VPN or proxy usage with just PHP and javascript.