Sign inSign up

ravshansbox/speed-test

By ravshansbox

•Updated 11 months ago

Speed Test

Image
Networking
0

820

ravshansbox/speed-test repository overview

⁠speed-test

A lightweight HTTP server for testing internet speed and bandwidth by streaming data of specified sizes.

⁠Features

  • Stream data of any size to test download speeds
  • Configurable via environment variables
  • Health check endpoint
  • Docker support

⁠Docker

⁠Using Prebuilt Image
docker run -p 8080:80 ravshansbox/speed-test

Test it:

curl -o /dev/null "http://localhost:8080"

With custom configuration:

docker run -p 8080:80 -e DEFAULT_SIZE=512 -e CHUNK_SIZE=128 ravshansbox/speed-test
⁠Build Your Own
docker build -t speed-test .
docker run -p 8080:80 speed-test

⁠Installation

npm install

⁠Usage

⁠Development
npm start

This starts the server on port 3000 with hot reload enabled.

⁠Production
HTTP_PORT=8080 node src/index.mjs

⁠Environment Variables

  • HTTP_PORT - Port to listen on (default: 80)
  • DEFAULT_SIZE - Default data size in MB (default: 1024)
  • CHUNK_SIZE - Chunk size in KB for streaming (default: 64)

⁠API Endpoints

⁠GET /

Streams random data for speed testing.

Query Parameters:

  • size (optional) - Size of data to stream in MB. Defaults to DEFAULT_SIZE (1024 MB).

Example:

curl -o /dev/null "http://localhost:3000/"
curl -o /dev/null "http://localhost:3000/?size=100"
⁠GET /health

Health check endpoint.

Response: Status: OK

⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:6dacfc064…

Size

54.7 MB

Last updated

11 months ago

docker pull ravshansbox/speed-test