diff --git a/README.md b/README.md index 61e3017..f0830de 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ This is the Docker version of LibreSpeed. See the included `doc.md` or the wiki for instructions on how to use it. +## Go backend +A Go implementation is available in the `go` branch, maintained by [Maddie Zhan](https://github.com/maddie). + ## Donate [![Donate with Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/fdossena/donate) [Donate with PayPal](https://www.paypal.me/sineisochronic) diff --git a/doc.md b/doc.md index caf5953..2fa866c 100644 --- a/doc.md +++ b/doc.md @@ -141,18 +141,6 @@ __Advanced parameters:__ (Seriously, don't change these unless you know what you * `1514 / 1440`: TCP+IPv6+ETH, ignoring HTTP overhead * `1`: ignore overheads. This measures the speed at which you actually download and upload files rather than the raw connection speed -### Multiple Points of Test -If you want to use more than one test server, this is the time to add all your test points and select the best one. Skip this part if you don't want to use this feature. - -The best way to do this is to declare an array with all your servers, and give it to the speedtest: -```js -var SPEEDTEST_SERVERS=[ - server1, - server2, - ... -]; -s.addTestPoints(SPEEDTEST_SERVERS); - ## Multiple Points of Test For multiple servers, you need to set up 1+ LibreSpeed backends, and 1 LibreSpeed frontend. @@ -173,7 +161,7 @@ docker run -e MODE=backend -p 80:80 -it adolfintel/speedtest ### Frontend mode In frontend mode, LibreSpeed serves clients the Web UI and a list of servers. To do this: * Set the `MODE` environment variable to `frontend` -* Create a servers.json file with your test points. The syntax is the following: +* Create a `servers.json` file with your test points. The syntax is the following: ``` [ { @@ -196,6 +184,11 @@ In frontend mode, LibreSpeed serves clients the Web UI and a list of servers. To ] ``` Note: if a server only supports HTTP or HTTPS, specify the protocol in the server field. If it supports both, just use `//`. + If you want the test to load this list from an URL instead of a file, just put the URL that you want to be loaded in the file in quotes, like this: + ``` + "//mydomain.com/ServerList.json" + ``` + It doesn't need to be a complete URL, if it's the same domain you can just specify the file name. Note that the same origin policy still applies. * Mount this file to `/servers.json` in the container The test can be accessed on port 80. diff --git a/docker/frontend.php b/docker/frontend.php index a5ff850..5c99e5d 100644 --- a/docker/frontend.php +++ b/docker/frontend.php @@ -22,29 +22,48 @@ s.setParameter("getIp_ispInfo","false"); s.setParameter("getIp_ispInfo_distance",""); -s.addTestPoints(SPEEDTEST_SERVERS); //add list of servers //SERVER AUTO SELECTION function initServers(){ - s.selectServer(function(server){ - if(server!=null){ //at least 1 server is available - I("loading").className="hidden"; //hide loading message - //populate server list for manual selection - for(var i=0;i