SpeedTest icon indicating copy to clipboard operation
SpeedTest copied to clipboard

Ability to test based on Server ID Number

Open jbtt3615 opened this issue 6 years ago • 8 comments

How can I run this tool and test based on Server ID number? I want to pass it list of 5 or more server IP's for approved servers and have it select the best from the 5.

jbtt3615 avatar Oct 15 '18 15:10 jbtt3615

This feature is not supported yet. There's --test-server host:port option but it accepts a single host only.

You can "hack" it in this way:

  1. Create your xml hosts file:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
   <servers>
     <server url="http://88.84.191.230/speedtest/upload.php" lat="70.0733" lon="29.7497" name="Vadso" country="Norway" cc="NO" sponsor="Varanger KraftUtvikling AS" id="4600"  url2="http://speedmonster.varangerbynett.no/speedtest/upload.php" host="88.84.191.230:8080" />
  </servers>
</settings>
  1. Host it somewhere

  2. Change this setting to point to your custom hosts file url https://github.com/taganaka/SpeedTest/blob/master/CMakeLists.txt#L12

  3. Recompile

taganaka avatar Oct 15 '18 16:10 taganaka

Okay Perfect! Thank you.

jbtt3615 avatar Oct 15 '18 16:10 jbtt3615

taganaka,

Not sure if this is out of line, but would like to discuss potentially contracting you to provide some additional tweaks to this app for a production environment. If that is possible, please let me know how best to get ahold of you.

jbtt3615 avatar Oct 15 '18 16:10 jbtt3615

Taganka,

Is there a way we can pull the XML file info from a local file on the device, rather than pull from a webserver?

jbtt3615 avatar Oct 24 '18 21:10 jbtt3615

@jbtt3615 The program uses libcurl to fetch remote file, libcurl supports file schema uri There's a chance it would work out of the box by using file:///path/to/your/local/file.xml as SpeedTest_SERVER_LIST_URL value

taganaka avatar Oct 24 '18 22:10 taganaka

According to the doc, the uri file schema should look like this: file://localhost/path/to/file.xml

There's another problem though. I explicitly check for 200 HTTP_OK: https://github.com/taganaka/SpeedTest/blob/master/SpeedTest.cpp#L429-L432

I'm pretty sure fetching a local file would not return HTTP 200 as http_status. Changing it should be pretty straight forward

taganaka avatar Oct 24 '18 22:10 taganaka

@jbtt3615 This should do the trick.

Please give it a try:

https://github.com/taganaka/SpeedTest/pull/17

taganaka avatar Oct 24 '18 23:10 taganaka

You are awesome.

jbtt3615 avatar Oct 25 '18 00:10 jbtt3615