Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpeedTest++

A fast, lightweight, and modern C++ command-line speed test client supporting both speedtest.net (raw TCP protocol) and Yandex Internetometer.


Features

  • Fast & Accurate: Uses raw TCP multi-threading to saturate bandwidth quickly.
  • Auto Server Discovery: Selects the best server based on latency and distance.
  • Interactive Server Picker: Choose servers interactively with filter support (--select).
  • Yandex Internetometer Support: Alternative test mode (--yandex) when Speedtest.net is blocked or throttled.
  • Result History: Saves test history to ~/.local/state/speedtest++/history.jsonl viewable via --history or --last.
  • Multiple Output Formats: Supports verbose (TUI/color), text (script-friendly), and json outputs.
  • Shareable Results: Generates speedtest.net result image URLs (--share).

Installation & Building

1. Install System Dependencies

Ubuntu / Debian / Linux Mint

sudo apt-get update
sudo apt-get install -y build-essential cmake libcurl4-openssl-dev libxml2-dev libssl-dev git

Fedora / RHEL / CentOS

sudo dnf install -y gcc-c++ cmake libcurl-devel libxml2-devel openssl-devel git

Arch Linux / Manjaro

sudo pacman -S --needed base-devel cmake curl libxml2 openssl git

OpenSUSE

sudo zypper install -y cmake gcc-c++ libcurl-devel libxml2-devel libopenssl-devel git

macOS

brew install cmake pkg-config libxml2 openssl curl git

2. Build from Source (Out-of-Source Build)

Always use out-of-source CMake builds to keep the source tree clean:

git clone https://github.com/cherrywheel/speedtest.git
cd speedtest

# Configure and build in 'build' directory
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

# Install system-wide (optional)
sudo cmake --install build

3. Portable / Static Build (For VDS & Other Linux Machines)

If you plan to copy the compiled binary to another server/VDS with different shared library versions (to avoid libxml2.so missing library errors):

cmake -B build -DENABLE_STATIC=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build

The resulting binary in ./build/SpeedTest will be statically linked against C++ runtimes and available static libraries, making it ready to run on target Linux machines.


4. Docker Usage

# Build Docker image
docker build -t speedtest .

# Run speed test
docker run --rm -it speedtest

Usage Examples

# Run standard speed test (latency, download, upload)
./build/SpeedTest

# Test using Yandex Internetometer
./build/SpeedTest --yandex

# Interactively pick a server
./build/SpeedTest --select

# List 10 nearest servers by latency
./build/SpeedTest --list=10

# Filter servers by city/sponsor
./build/SpeedTest --city "Frankfurt"

# Perform download test only
./build/SpeedTest --download

# Output result in JSON format
./build/SpeedTest --output json

# View previous test history
./build/SpeedTest --last
./build/SpeedTest --history=20

Command-Line Options

Option Description
--help Show help message and exit
--latency Perform latency test only
--quality Perform quality test (includes latency)
--download Perform download test only
--upload Perform upload test only
--share Generate result image URL on speedtest.net
--select Interactively select server from list
--no-select Automatically pick lowest-ping server
--list[=N] List N nearest servers with ping and exit
--city NAME Filter servers matching city/sponsor/host
--yandex Run test against Yandex Internetometer
--last Show most recent test result without running test
--history[=N] Show last N saved test results
--output TYPE Set output format (verbose, text, json)
--insecure Disable SSL certificate verification

Troubleshooting

1. Error: libxml2.so.16: cannot open shared object file

Cause: The binary was built on one Linux distribution and copied to another machine with a different libxml2 shared library version.
Fix: Build directly on the target machine, or build with static linking (cmake -B build -DENABLE_STATIC=ON).

2. Error: The current CMakeCache.txt directory ... is different than ...

Cause: An old CMakeCache.txt was created directly in the project root directory.
Fix: Clean out-of-source builds avoid this issue. Run rm -rf CMakeCache.txt CMakeFiles build and build using cmake -B build.


Credits & References


License

SpeedTest++ is released under the MIT License.

Future Functions

Make usable binary file

About

Fast, lightweight C++ speedtest CLI for speedtest.net & Yandex Internetometer. A no-browser alternative for testing bandwidth on headless VDS/servers.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages