Skip to content

Simple bandwidth test in browser javascript

License

Notifications You must be signed in to change notification settings

perryflynn/speedtest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

speedtest

Simple upload and download bandwidth test in browser javascript.

Demo

Demo

Demo Dev

Workflow

Download:

  • Test download with 5 Megabytes of data
  • Calculate a amount of data for a 15 Seconds long test
  • Perform download speed test

Upload:

  • Test upload with 5 Megabytes of data
  • Calculate a amount of data for a 15 Seconds long test
  • Perform upload speed test

Installation

Just download the index.html:

wget "https://github.com/perryflynn/speedtest/raw/upload/index.html"

Generate a large test file for download

# generates a 5GB large test file
dd if=/dev/urandom of=5000mb.bin bs=512 count=10000000

The test mechanism uses HTTP Byte Range Requests. After a short negotiation with 5 Megabytes, it uses extact this amount of data to run a test for 15 seconds.

Create fake endpoint for uploads

For example, you can use the upload.php as a test endpoint. You can also use any kind of other programming language.

The test just sends the test data in a raw request body.

No multipart upload.

Note on testing

With these kind of tools you are testing the available bandwidth of the slowest connection between your device and the host. When your web server connection is slower than your own network, you are actually testing the server's bandwidth instead of your own.

There can be many causes for slow connections, like the type of wiring, other devices, interference, packetloss or the peering between network providers somewhere along the route.

For example, I tested this speedtest from my own server to my home network both connected from Amsterdam and I got only 70 Mbit but using my provider's speedtest I get double at least. Doing the same to my LiquidSky box in Frankfurt I easily get over 900 Mbit. So there is a bottleneck somewhere between the web server and my home ISP.

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org/

The original Author

Franklin van de Meent

Do you like this project? Please consider to buy me a coffee.

Refactoring, negotiation mechanism and upload feature by

Christian Blechert

Do you like this project? Please consider to buy me a coffee.

About

Simple bandwidth test in browser javascript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 98.8%
  • PHP 1.2%