opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Cloudflare CDN delay and speed tester to find your fastest IP (IPv4+IPv6)
GitHub RepoImpressions4

Project Description

View on GitHub

CloudflareSpeedTest: Find the Fastest Cloudflare CDN IP for Your Location

If you've ever run ping or curl against a Cloudflare CDN endpoint and wondered why your speed is all over the place, you're not alone. Cloudflare's anycast network means your traffic is routed to the nearest PoP, but "nearest" isn't always "fastest" for your specific ISP or region.

There's a lightweight CLI tool from GitHub (by XIU2) that flips the problem: instead of hoping your traffic picks the right route, it actively tests a range of Cloudflare IPs (IPv4 and IPv6) and tells you which one gives you the best speed right now. No more "just use 1.1.1.1 and pray."

What It Does

CloudflareSpeedTest is a simple command-line tool written in Go. It downloads a list of commonly used Cloudflare CDN IPs (both IPv4 and IPv6), pings them in parallel, measures download latency, and then ranks them by speed and reliability.

You get a sorted table of IPs with latency (ms), jitter, and average download speed. The default test downloads a small file from each IP to simulate real CDN performance, not just ICMP ping times.

Why It's Cool

  • Dual stack support – IPv4 and IPv6 are tested separately, so you can pick the best IP for your connection type.
  • Parallel testing – It doesn't wait for each IP to finish sequentially. It uses goroutines to test many IPs at once, finishing in seconds instead of minutes.
  • Configurable – You can set the number of concurrent tests, the test file URL, and even filter by latency threshold. Want only IPs under 100ms? Done.
  • Zero configuration – Run it with no arguments, and it works. Great for first-timers.
  • Cross-platform – Precompiled binaries for Windows, macOS, Linux, and even ARM devices (Raspberry Pi, anyone?).
  • Real use case – If you're self-hosting behind Cloudflare, or if you're building a tool that uses Cloudflare's CDN, this helps you point your DNS at the fastest edge IP for your users.

How to Try It

The fastest way is to grab a precompiled binary from the releases page. For Linux/macOS:

# Download the latest Linux amd64 binary
wget https://github.com/XIU2/CloudflareSpeedTest/releases/latest/download/CloudflareSpeedTest_linux_amd64.tar.gz
tar -xzf CloudflareSpeedTest_linux_amd64.tar.gz
cd CloudflareSpeedTest_linux_amd64
./CloudflareSpeedTest

On macOS (Intel or Apple Silicon), grab the darwin version. On Windows, download the .exe and double-click.

If you prefer Go:

go install github.com/XIU2/CloudflareSpeedTest@latest

Then just run CloudflareSpeedTest from anywhere.

The tool will print a list of IPs sorted from fastest to slowest, with details. The top few are usually within 10ms of each other. Pick the first one, or set it in your hosts file or DNS resolver.

Final Thoughts

This tool isn't magic – it's just a smart, parallelized speed test against a curated list of Cloudflare IPs. But for anyone who regularly hits Cloudflare's edge (and that's most of us), it's surprisingly useful. I've seen cases where my "local" Cloudflare IP was 150ms while a "far away" IP was 40ms, purely because of routing quirks.

Is it a production-grade solution? No, but it's a great debugging and optimization tool. Keep it in your toolbox.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 7c7cebcf-07be-4a2b-92cc-8f31ed6145aaLast updated: July 8, 2026 at 10:20 AM