I'm implementing a browser extension which should connect to the nearest server to test the ping speed.
To have more details, kindly have a look on SpeedTest, it first calculates the ping time.
And to calculate this ping time, it detects the nearest servers and then pings it.
For example, here's the nearest servers detected by SpeedTest. I marked them in red arrows
How does SpeedTest detect these servers ?
i.e. How can I detect the nearest servers and their locations in javascript as SpeedTest does ?