Code Monkey home page Code Monkey logo

speedtest's Introduction

Speed Test

A self-hosted, lightweight speed test implemented in JavaScript, and based on Web Workers and XMLHttpRequest.

Demo

A demo is available here, running on a Digital Ocean server based on Amsterdam:

Usage

Compatibility

Chrome Edge Firefox Opera Safari
43 * 48.0 12.10 6.0

Features

  • IP Address (with ISP) detection
  • Latency and jitter tests
  • Download and upload bandwidth tests

Requirements

  • Some decent server CPU
  • Using HTTPS is highly discouraged, adding an heavy packet size and computing overhead
  • Using server compression is also discouraged, adding a computing overhead

Configuration

You can configure the speed test server following your needs. Find below the list of configurable options through the file config.json available at the root level of the server.
The key corresponds to the JSON path where to affect the value. For example, setting the value 2000 for the key download.delay corresponds to the following JSON:

{
  "download": {
    "delay": 2000
  }
}

List of configurable options:

Key Description Default value Possible values
analytics.trackingId The Google Analytics tracking ID to use on the speed test. "UA-XXXXXXXX-Y" or empty.
ignoreErrors Ignore the errors yielded by upload/download requests. If false, the test will be aborted at the first error. true true or false.
endpoints The available endpoints list. See Endpoints configuration below.
endpoint.xhr The endpoint to request for XHR. current location Any http:// or https:// endpoint exposing this speed test.
endpoint.websocket The endpoint to request for WebSocket. current location Any ws:// or wss:// endpoint exposing this speed test.
ip.path The path of the IP test on the XHR endpoint. ip
latency.path The path of the latency test on the WebSocket endpoint. ping
latency.count The count of latency requests to emit during the latency test. null Any positive integer.
latency.duration The duration in milliseconds of the latency test. 5000 Any positive integer.
latency.gracetime The duration in milliseconds at start of the latency test during which results are ignored. Used for test warm-up. 1000 Any positive integer.
download.path The path of the download test on the XHR endpoint. download
download.streams The number of concurrent streams to use during the download test. 6 Any positive integer.
download.delay The delay in milliseconds between the first request of each stream. 200 Any positive integer.
download.duration The duration in milliseconds of the download test. 10000 Any positive integer.
download.gracetime The duration in milliseconds at start of the download test during which results are ignored. Used for test warm-up. 2000 Any positive integer.
download.size The size in bytes downloaded on each download request. 8388608 (8M) Any positive integer.
download.adjustSize Auto adjust download packets size, depending on bandwidth. true
download.minSize The minimum size in bytes downloaded on each download request, to avoid excessively small requests. 1048576 (1M) Any positive integer.
download.maxSize The maximum size in bytes downloaded on each download request, to avoid excessively huge requests. 104857600 (100M) Any positive integer.
upload.path The path of the upload test on the XHR endpoint. upload
upload.streams The number of concurrent streams to use during the upload test. 6 Any positive integer.
upload.delay The delay in milliseconds between the first request of each stream. 200 Any positive integer.
upload.duration The duration in milliseconds of the upload test. 10000 Any positive integer.
upload.gracetime The duration in milliseconds at start of the upload test during which results are ignored. Used for test warm-up. 2000 Any positive integer.
upload.size The size in bytes uploaded on each upload request. 20971520 (2M) Any positive integer.
upload.adjustSize Auto adjust upload packets size, depending on bandwidth. true
upload.minSize The minimum size in bytes uploaded on each upload request, to avoid excessively small requests. 262144 (256K) Any positive integer.
upload.maxSize The maximum size in bytes uploaded on each upload request, to avoid excessively huge requests. 20971520 (20M) Any positive integer.
result.path The path of the save result request on the XHR endpoint. save

Endpoints configuration

{
  "endpoints": [
    {
      "label": "FR",
      "uri": "http://speedtest-fr.localhost:5080"
    },
    {
      "label": "FR (secured)",
      "uri": "https://speedtest-fr.localhost:5443"
    },
    {
      "label": "NL",
      "uri": "http://speedtest-nl.localhost:5080"
    },
    {
      "label": "UK",
      "uri": "http://speedtest-uk.localhost:5080"
    },
    {
      "label": "US",
      "uri": "http://speedtest-us.localhost:5080"
    }
  ]
}

Docker

Docker Pulls Docker Stars

Run the Speed Test container

docker run --name speedtest -d -p 80:80 e7db/speedtest

Store the results permanently

To store results permanently, you need a volume:

docker volume create speedtest_results
docker run --name speedtest -d -p 80:80 -v speedtest_results:/app/results e7db/speedtest

Note: Results are never cleaned automatically, used space will grow over time.

Use a custom configuration

To use a custom configuration through the config.json file, mount it through a read-only volume:

docker run --name speedtest -d -p 80:80 -v /path/to/config.json:/app/web/config.json:ro e7db/speedtest

Self-hosted server

Having cloned this repository and moved into the directory, issue the following commands:

npm run setup
npm run build
npm run start

Development

Prerequisites

Setup the repository

To setup, build and run the project for development, issue the following commands:

npm run setup:dev
npm run build:dev
npm run start:dev

Issues

If you encounter a problem with the Speed Test, please check if an existing issue adresses it and join the discussion. If not, feel free to create a new issue.

Support the project

You want to support the project? A speed test requires a server with high bandwidth. With Patreon, Paypal or cryprocurrencies, you can help me cover the fees!

Become a Patron on Patreon
Donate with Paypal
Donate Bitcoin 1D4fa6WDVNmKmwRJzTKDohYmHB9UzMsVVL
Donate Ethereum 0x57f1afbC888d6954F954B0960524E4aa5Fa188af

License

MIT License

Copyright (c) 2017-2019 Michaël "e7d" Ferrand

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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 OR COPYRIGHT HOLDERS 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.

speedtest's People

Contributors

dependabot[bot] avatar e7d avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

speedtest's Issues

IPv6

Hello.
Thankyou for the code.
I managed to get this working reliably on an Ubuntu server. I have recently tried to set this up on Redhat and whilst I know there shouldn't be any differences I am a bit puzzled at the behaviour I have noticed.
When I issue the npm run start command everything spins up nicely but it only seems to be listening on the IPv6 any address rather than the 0.0.0.0 IPv4 address.
I've googled and tried various things but I just can't seem to find the right config to adjust?
Thanks,
Bailey

max xhr requests, multiple servers parallel

Hey e7d,

chrome seems to limit the max parallel xhr requests to 6 per hostname.
is there any way you can implement that the speedtest can use multiple servers from the xhr.endpoints at the same time, exactly like speedtest.net is doing that...

This will max out the bandwith used on the client, while loading from multiple servers at the same time.

i have configured the xhr.endpoints, but i can only choose one at a time to test from, not all at the same time.

regards
dennore

Platform

Can I run it on repl.it please tell how to run

Links on about page don't work

If the about page were /about/, having the bookmark with no page before it would work, but, since the about page is /about, the links need to be about#bookmark in order to work correctly.

Command line arguments

Hi, the command line arguments don't work node server.js 80 ../web/dist . I changed it in the server.js file and its working great.
My actual question is there a way to get a report of who has tested and what the values are? Is there a database?

Thanks
Phreak

How to Rebuild Docker Container

What is the correct way to rebuild the docker container? I'm getting a ton of errors with:

docker build -t speedtest .

# docker build -t speedtest .
Sending build context to Docker daemon      2MB
Step 1/17 : FROM node:lts-alpine AS build
 ---> 710c8aa630d5
Step 2/17 : WORKDIR /app
 ---> Using cache
 ---> 51a81a42cee6
Step 3/17 : COPY lerna.json /app/lerna.json
 ---> Using cache
 ---> d6578c7a015d
Step 4/17 : COPY package.json /app/package.json
 ---> Using cache
 ---> 2426d7429398
Step 5/17 : COPY package-lock.json /app/package-lock.json
 ---> Using cache
 ---> 7f85d0ba0672
Step 6/17 : COPY packages /app/packages
 ---> Using cache
 ---> 8ec8279b4f5e
Step 7/17 : RUN apk add --no-cache   g++   make   python3   && npm run setup   && npm run build
 ---> Running in 58682bc340a3
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/24) Installing binutils (2.35.2-r2)
(2/24) Installing libgomp (10.3.1_git20210424-r2)
(3/24) Installing libatomic (10.3.1_git20210424-r2)
(4/24) Installing libgphobos (10.3.1_git20210424-r2)
(5/24) Installing gmp (6.2.1-r0)
(6/24) Installing isl22 (0.22-r0)
(7/24) Installing mpfr4 (4.1.0-r0)
(8/24) Installing mpc1 (1.2.1-r0)
(9/24) Installing gcc (10.3.1_git20210424-r2)
(10/24) Installing musl-dev (1.2.2-r3)
(11/24) Installing libc-dev (0.7.2-r3)
(12/24) Installing g++ (10.3.1_git20210424-r2)
(13/24) Installing make (4.3-r0)
(14/24) Installing libbz2 (1.0.8-r1)
(15/24) Installing expat (2.4.1-r0)
(16/24) Installing libffi (3.3-r2)
(17/24) Installing gdbm (1.19-r0)
(18/24) Installing xz-libs (5.2.5-r0)
(19/24) Installing mpdecimal (2.5.1-r1)
(20/24) Installing ncurses-terminfo-base (6.2_p20210612-r0)
(21/24) Installing ncurses-libs (6.2_p20210612-r0)
(22/24) Installing readline (8.1.0-r0)
(23/24) Installing sqlite-libs (3.35.5-r0)
(24/24) Installing python3 (3.9.5-r2)
Executing busybox-1.33.1-r6.trigger
OK: 237 MiB in 40 packages

> setup
> npm ci && lerna bootstrap

npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 752 packages, and audited 753 packages in 46s

27 packages are looking for funding
  run `npm fund` for details

50 vulnerabilities (19 moderate, 30 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
lerna notice cli v3.22.1
lerna info Bootstrapping 2 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in 'speedtest-web'
lerna ERR! npm install stderr:
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: 3.x is no longer supported
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /app/packages/web/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /app/packages/web/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/usr/local/bin/node',
npm ERR! gyp verb cli   '/app/packages/web/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (/app/packages/web/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/app/packages/web/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/app/packages/web/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (/app/packages/web/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/app/packages/web/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/app/packages/web/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (/app/packages/web/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/app/packages/web/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/app/packages/web/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python Error: not found: python
npm ERR! gyp verb `which` failed     at getNotFoundError (/app/packages/web/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed     at F (/app/packages/web/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed     at E (/app/packages/web/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed     at /app/packages/web/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (/app/packages/web/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/app/packages/web/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack     at F (/app/packages/web/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack     at E (/app/packages/web/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack     at /app/packages/web/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack     at /app/packages/web/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack     at /app/packages/web/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Linux 5.4.0-91-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/app/packages/web/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /app/packages/web/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-07T01_40_17_784Z-debug.log

lerna ERR! npm install exited 1 in 'speedtest-web'
npm notice
npm notice New minor version of npm available! 8.1.2 -> 8.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.2.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice
The command '/bin/sh -c apk add --no-cache   g++   make   python3   && npm run setup   && npm run build' returned a non-zero code: 1

error speedtest@ setup: `npm ci && lerna bootstrap`

When I test to run
npm run setup I receive the error :

> npm ci && lerna bootstrap


Usage: npm <command>

where <command> is one of:
    access, add-user, adduser, apihelp, author, bin, bugs, c,
    cache, completion, config, ddp, dedupe, deprecate, dist-tag,
    dist-tags, docs, edit, explore, faq, find, find-dupes, get,
    help, help-search, home, i, info, init, install,
    install-test, issues, it, la, link, list, ll, ln, login,
    logout, ls, outdated, owner, pack, ping, prefix, prune,
    publish, r, rb, rebuild, remove, repo, restart, rm, root,
    run-script, s, se, search, set, show, shrinkwrap, star,
    stars, start, stop, t, tag, team, test, tst, un, uninstall,
    unlink, unpublish, unstar, up, update, upgrade, v, verison,
    version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm faq          commonly asked questions
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    /root/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config


[email protected] /usr/share/npm

npm ERR! Linux 4.15.0-147-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "setup"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! speedtest@ setup: `npm ci && lerna bootstrap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the speedtest@ setup script 'npm ci && lerna bootstrap'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the speedtest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm ci && lerna bootstrap
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs speedtest
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls speedtest
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sct/speedtest/npm-debug.log

I don't know why...

speedtest behind nginx upload numbers wrong?

Hi e7d,
I am very new to speedtest. I was able to run it on my debian system from the docker container. It listens at port 8081. I also configured nginx port 8443 (hhtps) to proxy-pass to port 8081. Seems to work but when going through nginx (port 8443) the upload numbers are twice as high. When going direct to port 8081, the numbers are more reasonable. My client is on a 1Gbps NIC and the server on 10Gbps. As you can see in the attached picture, the upload speed was reported as high as 1.9Gbps, which is not possible (see history in attached picture). Have you run into this problem? Thank you.
Kind regards,
-santo

Slide3

Speedtest behind a Proxy in Nginx

Hey
I need help wit this speedtest!
istall was fine and Speedtest running without Problems but

when i call the site wit IP:5080 all is fine my ip is shown and speedtest works great

but

when i call the site via domain my speedtest dosent works correct! ( behind a Nginx proxy )

the speedtest dosent show the correkt ip! ( its shows the ip from server and not my own ip)

any solution for this? or is not Possible to bind a domain in this speedtest?

Cannot set any parameters in config.json

Dear Sir,

Thank you for this great software ! Very useful... I try to change some options, but it seem my config.json is never read, when I launch npm run start:dev, I've got my good config.json in "dist" directory, but the option don't seem to be used
Any help ? Thank you a lot !

Here is an example for my config.json file :

{
"download": {
"duration": 30
}
}

Speedtest Installation Failed

I got the below error when I run "npm run build".

<s> [webpack.Progress] 94% after seal
<s> [webpack.Progress] 100%

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `webpack --env=prod --progress --profile --colors`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-11-15T08_54_20_372Z-debug.log

lerna ERR! npm run build exited 2 in 'speedtest-web'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `lerna run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-11-15T08_54_20_893Z-debug.log

C:\Users\User\speedtest>

Running behind a Load Balancer, with and without SSL

Wanted to let you know about some oddities seen when running this in AWS, both with and without an ELB sitting in front of it. It is rock solid running in AWS overall, however if you put an ELB in front of your application and try to make it look "pretty" and add SSL, etc it looses its mind. It appears to end up testing the ELB to the application rather than the client to the application.

Thought you might want to add that warning into your docs.

I know you said to avoid SSL, I was just testing it outside the app since I wanted to see what the behaviour looked like.

Question

How to change default preview port of this?

REST API

Hi @e7d Thanks for creating a great tool! It works better and faster than any other solution that I've tried. It will be awesome to have make an API call using async JS and wait for the promise to resolve with the speed test results. Any plans to add a REST API?

GET: API/getSpeedTest

{
    "timestamp": 1585599313554,
    "latency": {
        "avg": 2.28
    },
    "jitter": "0.81",
    "download": {
        "speed": 185743917.45
    },
    "upload": {
        "speed": 176314401.3
    },
    "ipInfo": {
        "ip": "172.17.0.1"
    }
}

`node-sass` issue

When trying to install all dependencies, node-sass fails to build. Although Python exists, it is an outdated version requiring Python 2, which is unsupported. Upgrading to later versions of node-sass only causes more issues:

ERROR in   Error: Child compilation failed:
  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no load  ers are configured to process this file. See https://webpack.js.org/concepts#l  oaders
  > <section id="about" hidden>
  |  <h2>About the Speed Test</h2>
  | :
  SyntaxError: Unexpected token (1:0)
  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no load  ers are configured to process this file. See https://webpack.js.org/concepts#l  oaders
  > <section id="alerts">
  |  <div id="ie-alert" class="alert alert-warning alert-dismissible" hidden>
  |  <span class="message">Internet Explorer is not a <a href="about#supported-b  rowsers">suported:
  SyntaxError: Unexpected token (1:0)
  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no load  ers are configured to process this file. See https://webpack.js.org/concepts#l  oaders
  > <section id="history" hidden>
  |  <h2>Previous results</h2>
  | :
  SyntaxError: Unexpected token (1:0)
  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no load  ers are configured to process this file. See https://webpack.js.org/concepts#l  oaders
  > <section id="settings" hidden>
  |  <div class="flex">
  |  <h2>Settings</h2>:
  SyntaxError: Unexpected token (1:0)
  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no load  ers are configured to process this file. See https://webpack.js.org/concepts#l  oaders
  > <section id="share" hidden>
  |  <div class="text-center">
  |  <img id="share-result-image-preview" class="img-thumbnail" alt="Speed Test   results">:
  SyntaxError: Unexpected token (1:0)
  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no load  ers are configured to process this file. See https://webpack.js.org/concepts#l  oaders
  > <section id="speedtest" class="ready">
  |  <div id="progress" class="progress">
  |  <div class="progress-bar" role="progressbar"></div>:
  SyntaxError: Unexpected token (1:0)

  - compiler.js:79
    [web]/[html-webpack-plugin]/lib/compiler.js:79:16

  - Compiler.js:343
    [web]/[webpack]/lib/Compiler.js:343:11

  - Compiler.js:681
    [web]/[webpack]/lib/Compiler.js:681:15


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
    [web]/[tapable]/lib/Hook.js:154:20

  - Compiler.js:678
    [web]/[webpack]/lib/Compiler.js:678:31


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
    [web]/[tapable]/lib/Hook.js:154:20

  - Compilation.js:1423
    [web]/[webpack]/lib/Compilation.js:1423:35


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
    [web]/[tapable]/lib/Hook.js:154:20

  - Compilation.js:1414
    [web]/[webpack]/lib/Compilation.js:1414:32


  - task_queues:96 processTicksAndRejections
    node:internal/process/task_queues:96:5

ARM Image?

Any plans on an linux/arm/v7 image? Keen to run this on one of my RPI's. Thanks

Could not install speedtest following guide from README file

vadym@ubuntu:~$ git clone [email protected]:vikulin/speedtest.git
Cloning into 'speedtest'...
remote: Enumerating objects: 464, done.
remote: Counting objects: 100% (464/464), done.
remote: Compressing objects: 100% (303/303), done.
remote: Total 3700 (delta 255), reused 303 (delta 158), pack-reused 3236
Receiving objects: 100% (3700/3700), 2.59 MiB | 708.00 KiB/s, done.
Resolving deltas: 100% (2291/2291), done.
vadym@ubuntu:~$ cd speedtest/
vadym@ubuntu:~/speedtest$ ls
assets  Dockerfile  lerna.json  LICENSE  package.json  package-lock.json  packages  README.md
vadym@ubuntu:~/speedtest$ cd packages/web
vadym@ubuntu:~/speedtest/packages/web$ npm ci

> [email protected] install /home/vadym/speedtest/packages/web/node_modules/fsevents
> node-gyp rebuild

make: Entering directory '/home/vadym/speedtest/packages/web/node_modules/fsevents/build'
  SOLINK_MODULE(target) Release/obj.target/.node
  COPY Release/.node
make: Leaving directory '/home/vadym/speedtest/packages/web/node_modules/fsevents/build'

> [email protected] install /home/vadym/speedtest/packages/web/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-64_binding.node
Download complete .] - :
Binary saved to /home/vadym/speedtest/packages/web/node_modules/node-sass/vendor/linux-x64-64/binding.node
Caching binary to /home/vadym/.npm/_cacache/node-sass/4.14.1/linux-x64-64_binding.node

> [email protected] postinstall /home/vadym/speedtest/packages/web/node_modules/node-sass
> node scripts/build.js

Binary found at /home/vadym/speedtest/packages/web/node_modules/node-sass/vendor/linux-x64-64/binding.node
Testing binary
Binary is fine

> [email protected] postinstall /home/vadym/speedtest/packages/web/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 1197 packages in 17.219s
vadym@ubuntu:~/speedtest/packages/web$ npm run dist
npm ERR! missing script: dist
npm ERR! 
npm ERR! Did you mean this?
npm ERR!     test

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vadym/.npm/_logs/2020-08-02T10_24_49_435Z-debug.log
vadym@ubuntu:~/speedtest/packages/web$ cd ..
vadym@ubuntu:~/speedtest/packages$ cd ..
vadym@ubuntu:~/speedtest$ ls
assets  Dockerfile  lerna.json  LICENSE  package.json  package-lock.json  packages  README.md
vadym@ubuntu:~/speedtest$ cd cd packages/web
bash: cd: too many arguments
vadym@ubuntu:~/speedtest$ cd packages/web
vadym@ubuntu:~/speedtest/packages/web$ ls
build  node_modules  package.json  package-lock.json  src  webpack.common.js  webpack.config.js  webpack.dev.js  webpack.prod.js
vadym@ubuntu:~/speedtest/packages/web$ cd build/
vadym@ubuntu:~/speedtest/packages/web/build$ ls
app.js  serviceWorker.js
vadym@ubuntu:~/speedtest/packages/web/build$ cd ..
vadym@ubuntu:~/speedtest/packages/web$ cd ..
vadym@ubuntu:~/speedtest/packages$ cd ..
vadym@ubuntu:~/speedtest$ cd packages/server
vadym@ubuntu:~/speedtest/packages/server$ npm ci --production

> [email protected] install /home/vadym/speedtest/packages/server/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory '/home/vadym/speedtest/packages/server/node_modules/websocket/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory '/home/vadym/speedtest/packages/server/node_modules/websocket/build'
added 29 packages in 6.203s
vadym@ubuntu:~/speedtest/packages/server$ node server.js 80 ../web/dist
The web folder does not exists: /home/vadym/speedtest/packages/server/web
vadym@ubuntu:~/speedtest/packages/server$ ls

Missing js and css when using a reverse Proxy in a subdirectory

Version: 0.5.3

I am using traefik as a reverse proxy in front of speedtest. traefik is configured to forward requests to example.com/speedtest/ to speedtest and strip the /speedtest/ prefix. To speedtest, it looks like it is simply hosted in a root directory.

When accessing the site the HTML is loaded but the icon, js, and CSS files are not loaded because the path is example.com/app.js and not example.com/speedtest/app.js. If I change the path manually in my browser I get a 200 response.

Github Issue

librsvg-CRITICAL on results page (Docker)

Hi,

I get these errors when I try to share a link or am on the results page.

Version:
latest docker image

My docker-compose.yml config:

version: '3'

services:
  speedtest:
    image: e7db/speedtest:latest
    restart: always
    ports:
      - "8083:80"
    volumes:
      - ./results:/app/results

Error message in console:
GET http://x.x.x.x:8083/results/Command failed: (process:19): librsvg-CRITICAL **: 11:01:58.950: Handle could not read or parse the SVG; did you check for errors during the loading stage.json

Uncaught DOMException: Document.querySelectorAll: 'circle[result-id="Command failed: 
(process:19): librsvg-CRITICAL **: 11:01:58.950: Handle could not read or parse the SVG; did you check for errors during the loading stage?

(process:19): librsvg-CRITICAL **: 11:01:58.951: Handle could not read or parse the SVG; did you check for errors during the loading stage?
convert: negative or zero image size `/app/results/72da8075-091e-472e-91b3-d6589ebbf571.svg' @ error/image.c/SetImageExtent/2661.
convert: no decode delegate for this image format `/app/results/72da8075-091e-472e-91b3-d6589ebbf571.svg' @ error/svg.c/ReadSVGImage/3401.
convert: no images defined `/app/results/72da8075-091e-472e-91b3-d6589ebbf571.png' @ error/convert.c/ConvertImageCommand/3273.
"]' is not a valid selector app.cbb9b66b.js:1
    toggleCirclesFocus http://x.x.x.x:8083/app.cbb9b66b.js:1
    printTable http://x.x.x.x:8083/app.cbb9b66b.js:1

Best regards
Dominion

Is there any way to...?

Hello, is there any way to let customers be able only to perform PING test?
Maybe I should HIDE the other results (download/upload)?

Thank you in advice.

Add a option to disable fetch ipinfo

Hi, it seems we can't disable fetch ipinfo yet.
It'd be nice to add an option to disable ipinfo function, so Speedtest can run on the intranet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.