1 Alternative backends
Federico Dossena edited this page 2019-06-30 07:46:04 +02:00

If for some reason you can't or don't want to use PHP, the speedtest can run with other backends, or even no backend (with limited functionality).

You will need replacements for backend/garbage.php and backend/empty.php and optionally backend/getIP.php, and the test needs to know where to find them:

//Speedtest initialization
var s=new Speedtest();
...
//Custom backend
s.setParameter("url_dl","URL to your garbage.php replacement");
s.setParameter("url_ul","URL to your empty.php replacement");
s.setParameter("url_ping","URL to your empty.php replacement");
s.setParameter("url_getIp","URL to your getIP.php replacement");

Replacement for garbage.php

A replacement for garbage.php must generate incompressible garbage data.

A large file (10-100 Mbytes) is a possible replacement. You can get one here.

A symlink to /dev/urandom is also ok.

If you want to make your own backend, see the section on the implementation details of garbage.php.

Replacement for empty.php

Your replacement must simply respond with a HTTP code 200 and send nothing else. You may want to send additional headers to disable caching. The test assumes that Connection:keep-alive is sent by the server.

An empty file can be used for this.

If you want to make your own backend, see the section on the implementation details of empty.php.

Replacement for getIP.php

Your replacement can simply respond with the client's IP as plaintext or do something more fancy.

If you want to make your own backend, see the section on the implementation details of getIP.php.