From f3ae81290de1285d90b404ee7772f3af11bc1e68 Mon Sep 17 00:00:00 2001 From: Tom Sacher Date: Sun, 22 Apr 2018 18:56:48 +0200 Subject: [PATCH] nodeJS Port release --- .editorconfig | 18 ---- .idea/workspace.xml | 226 ++++++++++++++++++++++++-------------------- README.md | 6 ++ src/SpeedTest.js | 4 +- 4 files changed, 133 insertions(+), 121 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index e9e6a98..0000000 --- a/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -root = true - -[*] -end_of_line = lf -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 -charset = utf-8 - -[*.js] -indent_size = 4 -indent_style = space - -[*.md] -trim_trailing_whitespace = false diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f3fb2d7..aa624b2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,28 +2,10 @@ - - - - + + - - - - - - - - - - - - - - - - - + @@ -36,12 +18,12 @@ - + - - + + @@ -57,18 +39,12 @@ - - - - - - - - - - - - + + + + + + @@ -76,7 +52,7 @@ - + @@ -85,7 +61,7 @@ - + @@ -94,10 +70,10 @@ - - + + - + @@ -122,8 +98,8 @@ @@ -143,7 +119,6 @@ - - - - + - + - - - + + - + - + - - + + + @@ -243,51 +218,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -303,9 +233,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/README.md b/README.md index aab620d..f6fdfe0 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,16 @@ This is a s nodeJS Port from [adolfintel's HTML5 Speedtest](https://github.com/adolfintel/speedtest) +## Installation +For any instructions and support please check out the [Wiki](https://github.com/adolfintel/speedtest/wiki) + ## License Copyright (C) 2016-2018 Federico Dossena +Copyright (C) 2018 dunklesToast + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or diff --git a/src/SpeedTest.js b/src/SpeedTest.js index e48e60f..1d0d210 100644 --- a/src/SpeedTest.js +++ b/src/SpeedTest.js @@ -31,12 +31,12 @@ Server.get('/garbage', function (req, res) { if (cache.size === requestedSize) { res.end(cache.random); } else { - const size = 1048576 * (req.query.ckSize || 100); + const size = 1048576 * requestedSize; randomBytes(size, (error, bytes) => { if (error) res.sendStatus(500); else { cache.random = bytes; - cache.size = (req.query.ckSize || 100); + cache.size = requestedSize; res.end(bytes); } })