Coder Social home page Coder Social logo

rebootcs / speedtest-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from miquels/speedtest

0.0 1.0 0.0 1.23 MB

HTML5 speedtest, javascript client and golang server. Responsive interface, can be used on desktop, tablets and phones. Uses the same algorithm as Ookla / speedtest.net, and gives approximately the same results.

JavaScript 18.26% HTML 0.84% Vue 47.64% Makefile 0.47% Go 4.22% Rust 24.04% SCSS 4.53%

speedtest-1's Introduction

speedtest

========================================

THIS REPOSITORY HAS BEEN ARCHIVED AS OF 02-May-2021

This project will not be developed any further.

========================================

HTML5 Speedtest

This speedtest uses the same algorithm as the Ookla / speedtest.net test. Because of that it gives about the same results.

It has a responsive interface, and can be used on desktop, tablets and phones.

speedtest-dark

Development / Build Setup

  • as usual, you need nodejs and yarn.
  • you need to have Rust (compiler + cargo) installed, version 1.40 or later.

Right now no Linux distributions come with a recent enough Rust. You need to install it manually. Instructions can be found on https://rustup.rs/, but for Linux and macos it boils down to:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then clone the repo and build:

# clone repo
git clone https://github.com/miquels/speedtest.git
cd speedtest

# install dependencies
yarn

# install configuration file
cp public/config.json.example public/config.json
vim public/config.json

# serve with hot reload at localhost:8080
yarn serve

Run the backend server

# build backend server
cd server
source ~/.cargo/env # should not be needed, but try if the below fails.
cargo build --release
cd ..

# run server
server/target/release/speedtest-server

If you point yout browser at localhost:8080, you should see the webinterface.

If it doesn't work, use your browsers debugger/inspector, and look at the javascript console - that should give you a hint as to what is going on. For example, Chrome on OSX, press Option + Command + J.

Production use

# build and minify.
yarn build

# copy files to your webservers root. change /path/to/www/html to the
# actual path on your system (e.g. debian: /var/www/html).
cp -av dist/* /path/to/www/html/

Before you can use the app, you need to run the backend server as well.

Running the backend server.

If you have compiled the server as described above, its binary needs to be copied to a generic location, for example:

cp server/target/release/speedtest-server /usr/local/sbin/speedtest-server

The server needs to be run as a daemon. That's OS specific, and no sysv / systemd / whatever files have been included yet. The easiest solution is to run it in a screen session for now :)

screen
/usr/local/sbin/speedtest-server
# Press "Control-a d" to detach
# Use "screen -x" to re-attach

There are several command line options you can use, such as:

  • --key, --chain: options for TLS (SSL) support
  • --dir: serve the entire app, not just the speedtest backend
  • --listen: address/port to listen on (default 4000)
  • --help: get a list of all options.

For example, to serve TLS on port 443:

/usr/local/sbin/speedtest-server --key certificate.key \
        --chain certificate.pem --listen 443 --dir /var/www/html/speedtest
# Note: set `apiport` in `config.json` to 443, or just comment it out.

Note that the server does not write any access logs. If you do need access logs, you can get them (at least for the application itself, html/css/javascripts/assets) by serving the application using a generic webserver like Apache or Nginx, and running the api server on a separate port.

speedtest-1's People

Contributors

miquels avatar dependabot[bot] avatar kukac7 avatar

Watchers

 avatar

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.