Skip to content

ctllmp/speedtestdemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Network Speed Test

This project is a lightweight browser-based network speed test implemented using Flask on the backend and vanilla HTML/CSS/JavaScript on the frontend. It measures ping (the round-trip time between the user’s browser and the server), jitter, packet loss, download speed, and upload speed.

A live version of this project is hosted on Render.com (server location: Frankfurt, Germany), and anyone can test it here:

👉 https://speedtestdemo.onrender.com/

When the user follows the link, a user friendly speed testing UI appears. When the push button is pressed, the internet speed information of the user is displayed. When the testing finishes, the upload speed is displayed in the middle of the website and all other results are displayed below.


1. Project Structure

project/
│ app.py
│ requirements.txt
│ README.md
│
└───static/
     │ index.html
     │ script.js
     │ style.css

2. Requirements

  • Python 3.9+
  • Flask 3.0.3
    (Installed via requirements.txt)

No additional packages are required.


3. Installation

1. Clone or extract the project folder.

2. Install dependencies

pip install -r requirements.txt

3. Running the Application

Start the Flask server:

python app.py

The server will run on:

http://localhost:5000

Open this URL in a browser to access the speed test interface.


4. How It Works

Backend (Flask)

The backend exposes lightweight endpoints:

Endpoint Purpose
/ Serves the UI (index.html)
/pg Ping test — quick HTTP response ("pong")
/dw Download test — returns a payload for download
/up Upload test — accepts POST uploads to measure time
/server-info Returns server IP, hostname and platform info
/path:filename Serves other static files (JS, CSS, images, etc.)

Frontend

Located in static/:

  • index.html --- Main UI\
  • script.js --- Logic for ping, download, upload measurements\
  • style.css --- Styling

Frontend tests run in three phases: ping → download → upload.


5. Multithreading & Flask

The server is built using Flask because it is lightweight, easy to configure, and allows quick creation of multiple endpoints (/pg, /dw, /up, /server-info) with minimal dependencies. It runs in threaded mode (threaded=True) to handle multiple simultaneous requests from the frontend. Each download and upload test spawns 4 parallel fetch requests. Multithreading prevents bottlenecks and ensures accurate measurement.


6. Hosting on Render

The project is deployed and publicly accessible at:

https://speedtestdemo.onrender.com/


8. Notes

  • Uses no external libraries other than Flask.
  • Streaming download improves measurement realism.
  • Multithreaded server enables parallel fetch requests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages