Reputation: 223
Is there any way that I can allow a user to ping a test IP that will go from
User --> Server --> Their Actual Ping Not The Servers
I know you can ping using PHP, but PHP can't execute anything from the clients side.
jQuery maybe?
Thanks for any tips or suggestions.
Upvotes: 1
Views: 1129
Reputation: 173562
JavaScript isn't capable of performing an ICMP Echo request which is use to ping a server.
The closest alternative is to make an HTTP request using the XMLHttpRequest
or Image
object and measure the time taken; of course, the time taken for that is the combination of DNS lookup, TCP handshake, sending headers, server processing and receiving the response.
I should note that after the first "ping" the subsequent requests are probably more accurate.
Upvotes: 1