Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,29 @@ Let's install the speed test.

Put all files on your web server via FTP or by copying them directly. You can install it in the root, or in a subdirectory.

**Web server upload limit:** The upload test sends POST requests up to 20 MB (configurable with `xhr_ul_blob_megabytes`). Without proper configuration, the server will reject these with HTTP 413, causing wildly inaccurate upload speeds. Configure your web server to accept large request bodies:

Nginx:
```
client_max_body_size 128m;
```

Apache:
```
LimitRequestBody 134217728
```

IIS: Add the following to `web.config` (value is in bytes):
```xml
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="134217728" />
</requestFiltering>
</security>
</system.webServer>
```

__Important:__ The speed test needs write permissions in the installation folder!

#### ipinfo.io
Expand Down
10 changes: 10 additions & 0 deletions speedtest_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ function ulTest(done) {
delete xhr[i];
if (settings.xhr_ignoreErrors === 1) testStream(i, 0); //restart stream
}.bind(this);
xhr[i].onload = function() {
// check HTTP status after full response is available
if (xhr[i].status >= 200 && xhr[i].status < 300) return;
tverb("ul stream failed with HTTP " + xhr[i].status + " " + i);
if (settings.xhr_ignoreErrors === 0) failed = true; //abort
try {
xhr[i].abort();
} catch (e) {}
delete xhr[i];
}.bind(this);
// send xhr
xhr[i].open("POST", settings.url_ul + url_sep(settings.url_ul) + (settings.mpot ? "cors=true&" : "") + "r=" + Math.random(), true); // random string to prevent caching
try {
Expand Down