Skip to content

It is a simple web page in which you can check the speed of your network

Notifications You must be signed in to change notification settings

Sachin23991/networkspeed

Repository files navigation

NetworkSpeed

A lightweight, browser-based internet speed test application built with Node.js and Express

Live DemoRepository

🚀 Overview

NetworkSpeed is a simple yet effective web-based speed test tool that measures your internet download speed directly from your browser. No installations, no plugins—just open the link and test your connection instantly.

✨ Features

  • 🌐 Browser-based - Works on any device with a web browser
  • No Installation - Run instantly without setup
  • 📊 Real-time Results - Get download speed in Mbps instantly
  • 💾 Lightweight - Uses a fixed 10MB test file for accurate measurements
  • 🔧 Simple Architecture - Easy to understand and modify
  • 🚀 Easy Deployment - Deploy on Render, Railway, Vercel, or any Node host

🛠️ Tech Stack

Component Technology
Backend Node.js, Express
Frontend HTML5, CSS3, Vanilla JavaScript
Test File Binary file (10MB.bin)
Hosting Render (Demo)

📁 Project Structure

networkspeed/
├── index.html          # Main UI template
├── style.css           # Styling for the speed test UI
├── speedtest.js        # Client-side speed test logic
├── server.js           # Express server configuration
├── 10MB.bin            # Test file for download speed measurement
├── package.json        # Node.js dependencies
├── package-lock.json   # Dependency lock file
└── README.md           # This file

🔍 How It Works

  1. User clicks "Start Test" → Browser initiates a download request
  2. Download begins → JavaScript records the start timestamp
  3. File transfers → Browser downloads 10MB.bin from the server
  4. Download completes → JavaScript records the end timestamp
  5. Speed calculation → App calculates: (File Size in Mb) / (Time in seconds) = Mbps
  6. Results displayed → Download speed is shown to the user

Speed Calculation Formula

Download Speed (Mbps) = (File Size: 10 MB × 8 bits/byte) / Download Time (seconds)

🚀 Getting Started

Prerequisites

  • Node.js (v14+)
  • npm or yarn

Installation

  1. Clone the repository:

    git clone https://github.com/Sachin23991/networkspeed.git
    cd networkspeed
  2. Install dependencies:

    npm install
  3. Start the server:

    npm start

    Or for development with auto-reload:

    npm run dev
  4. Open in browser:

    http://localhost:3000
    

📋 API Endpoints

GET /10MB.bin

Returns the 10MB test file for speed testing

  • Response: Binary file (10MB)
  • Content-Type: application/octet-stream

GET /

Serves the main index.html page

  • Response: HTML page
  • Content-Type: text/html

⚙️ Configuration

Environment Variables

Create a .env file if needed:

PORT=3000
NODE_ENV=development

Customization

Modify the test file size in speedtest.js:

const TEST_FILE_SIZE = 10; // in MB

📊 Important Notes

  • Accuracy: Speed test accuracy depends on:

    • Your network conditions
    • Server location and availability
    • Server load during testing
    • Browser caching behavior
  • Browser Compatibility: Works on all modern browsers (Chrome, Firefox, Safari, Edge)

  • Mobile Testing: Fully responsive and works on mobile devices

🌐 Deployment

Deploy to Render

  1. Push your code to GitHub
  2. Connect your GitHub repo to Render
  3. Set build command: npm install
  4. Set start command: npm start
  5. Deploy!

Deploy to Railway

railway link
railway up

Deploy to Vercel

Note: Vercel's serverless functions have execution limits. For larger files, consider Render or Railway.

🔐 Privacy & Security

  • No data collection or analytics
  • Speed test results are calculated locally in your browser
  • No user information is stored or transmitted
  • No cookies or tracking

📝 License

This project is open source and available under the MIT License.

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest improvements
  • Submit pull requests
  • Share feature ideas

💡 Future Improvements

  • Upload speed testing
  • Ping/latency measurement
  • Multiple server locations
  • Speed test history
  • Comparison with ISP speeds
  • Network stability analysis
  • Dark mode toggle

📧 Contact

For questions or feedback, reach out on GitHub: Sachin23991


Made with ❤️ by Sachin

About

It is a simple web page in which you can check the speed of your network

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published