openspeedtest / Speed-Test

SpeedTest by OpenSpeedTestâ„¢ is a Free and Open-Source HTML5 Network Performance Estimation Tool Written in Vanilla Javascript and only uses built-in Web APIs like XMLHttpRequest (XHR), HTML, CSS, JS, & SVG. No Third-Party frameworks or libraries are Required. Started in 2011 and moved to OpenSpeedTest.com dedicated Project/Domain Name in 2013.
https://openspeedtest.com
MIT License
2.28k stars 221 forks source link

Multiple servers doesn't work #98

Closed hexahigh closed 1 year ago

hexahigh commented 1 year ago

Hello, i have not managed to make the multiple servers feature work. I have tried on the static version and the docker version. The client wont choose the server with least latency and will choose the first server in the list.

openspeedtest commented 1 year ago

Edit https://github.com/openspeedtest/Speed-Test/blob/main/index.html#L49 ?

  var openSpeedTestServerList = [
        {"ServerName":"Home", "Download":"downloading", "Upload":"upload", "ServerIcon":"DefaultIcon"},
       {"ServerName":"Home", "Download":"htttp://server2.com/downloading", "Upload":"htttp://server2.com/upload", "ServerIcon":"DefaultIcon"},
       {"ServerName":"Home", "Download":"htttp://server3.com/downloading", "Upload":"htttp://server3.com/upload", "ServerIcon":"DefaultIcon"}
      ];
hexahigh commented 1 year ago

that is what i did

hexahigh commented 1 year ago

Here is my config:

    var openSpeedTestServerList = [
        {"ServerName":"Home", "Download":"downloading", "Upload":"upload", "ServerIcon":"DefaultIcon"},
        {"ServerName":"GH pages", "Download":"https://hexahigh.github.io/Speed-Test/downloading", "Upload":"https://hexahigh.github.io/Speed-Test/upload", "ServerIcon":"DefaultIcon"},
        {"ServerName":"OST", "Download":"https://openspeedtest.com/downloading", "Upload":"https://openspeedtest.com/upload", "ServerIcon":"DefaultIcon"}
      ];            
openspeedtest commented 1 year ago

http://192.168.1.1 is my router running OST. http://192.168.1.201 is my MBP running OST. When you give 192.168.1.201, you can see 3000+ Mbps http://192.168.1.1 vis WiFi is just 300+ Mbps.

Check your console. You should have permission to use the server. GitHub or OpenSpeedTest may not allow you to make XHR requests. Learn more about cross-origin resource sharing (CORS).

Launch OpenSpeedTest Docker in AWS, Linode, or DO in multiple locations and provide URLs like this. It will choose the one with the least latency.

  var openSpeedTestServerList = [
        {"ServerName":"Home", "Download":"http://192.168.1.1:3000/downloading", "Upload":"http://192.168.1.1:3000/upload", "ServerIcon":"DefaultIcon"},
        {"ServerName":"Home", "Download":"http://192.168.1.201:3000/downloading", "Upload":"http://192.168.1.201:3000", "ServerIcon":"DefaultIcon"}
      ];

https://github.com/openspeedtest/Speed-Test/assets/51720450/3ac9a388-15c6-4593-a505-74fecc59912d

hexahigh commented 1 year ago

Thanks, that was the problem.