Skip to content

WhoisGray/NetReach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘
โ•šโ•โ•  โ•šโ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•   โ•šโ•โ•   โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•

Find what's still reachable when the network says no. ๐Ÿ›ฐ๏ธ

Release License Downloads Stars Platforms Made for CI

Download ยท Docs ยท Use with v2ray ยท Build from source


TL;DR โ€” Drop a single binary onto your machine. NetReach hammers ~1900 well-known endpoints (and any list you give it) with TCP, HTTPS, and HTTP probes in parallel, then hands you a sorted JSON of the IPs that actually answered. Built for the kind of internet where ping lies and only one port works.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ target              โ”‚ ip               โ”‚ cc  โ”‚ asn   โ”‚ ms  โ”‚ tcp โ”‚ https โ”‚ http โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ cloudflare.com      โ”‚ 104.16.132.229   โ”‚ USA โ”‚ CFLR  โ”‚  12 โ”‚  12 โ”‚  301  โ”‚  301 โ”‚
โ”‚ github.com          โ”‚ 140.82.121.4     โ”‚ USA โ”‚ GITHB โ”‚  20 โ”‚  20 โ”‚  200  โ”‚  301 โ”‚
โ”‚ vercel.com          โ”‚ 76.76.21.21      โ”‚ USA โ”‚ VRCL  โ”‚  87 โ”‚  87 โ”‚  308  โ”‚  301 โ”‚
โ”‚ huggingface.co      โ”‚ 3.163.189.114    โ”‚ USA โ”‚ AMZN  โ”‚  92 โ”‚  92 โ”‚  301  โ”‚   -  โ”‚
โ”‚ pypi.org            โ”‚ 151.101.0.223    โ”‚ USA โ”‚ FSTLY โ”‚ 105 โ”‚ 105 โ”‚  200  โ”‚  301 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  Domains: 1900/1900  |  IPs: 4218  |  OK: 612  |  FAIL: 3606  |  Elapsed: 41.3s

โœจ Why NetReach?

On a hostile network, every tool lies in a different way:

Symptom Why your usual tool fails
ping returns 100% loss ICMP is silently dropped at the border
curl hangs forever Port 80 is filtered, but 443 is fine
TLS handshake works, page is 403 SNI-based filtering is closing the right connection
One Cloudflare IP works, another doesn't DPI is killing specific edges, not the whole CDN

NetReach probes TCP/443, HTTPS/443 (SNI + Host), and HTTP/80 in parallel for every IP of every target. A host is reported reachable if any probe answers. Results are sorted by best latency and annotated with country + ASN โ€” so you can pick clean Cloudflare edges, fast Fastly nodes, or whatever else your network still likes.

๐Ÿš€ Install

Grab the latest binary for your platform from the Releases page:

Platform Asset
๐Ÿง Linux x64 netreach-linux-x64.zip
๐Ÿง Linux ARM64 netreach-linux-arm64.zip
๐ŸŽ macOS Apple Silicon netreach-macos-arm64.zip
๐ŸŽ macOS Intel netreach-macos-x64.zip
๐ŸชŸ Windows x64 netreach-windows-x64.zip
# Linux / macOS
unzip netreach-*.zip
chmod +x netreach-*
./netreach-*

# Windows
Expand-Archive netreach-windows-x64.zip
.\netreach-win32-x64.exe

๐Ÿ’ก macOS quarantine? First run may be blocked. Either right-click โ†’ Open, or: xattr -d com.apple.quarantine ./netreach-darwin-arm64

No Node.js, no pip, no apt install. One file. Geo databases and a 1900-target seed list are baked into the binary.

๐Ÿ›ก๏ธ Use with v2ray / Xray / sing-box

This is what most people use NetReach for: finding clean Cloudflare IPs to plug into a proxy config.

# 1. Scan Cloudflare-fronted endpoints
echo "cloudflare.com" > cf-targets.txt
echo "www.cloudflare.com" >> cf-targets.txt
echo "104.16.0.0/13" >> cf-targets.txt
./netreach cf-targets.txt -o cf.json --no-banner

# 2. Pull the 10 fastest IPs into a file
jq -r '.[0:10][] | .ip' cf.json > clean-ips.txt

# 3. Feed them into your proxy config
#    Xray: route.rules[].ip
#    sing-box: outbounds[].server
#    v2ray: outbounds[].settings.servers[].address

Pair NetReach with an idle-time cron job to keep your list fresh:

# crontab: refresh every 6 hours
0 */6 * * * /opt/netreach -q -o /etc/proxy/clean-ips.json --top 50

๐ŸŽฎ Usage

netreach [OPTIONS] [TARGETS_FILE]
Flag What it does Default
-o, --output <file> Write reachable results as JSON result.json
-c, --concurrency <n> Parallel probes 200
--tcp-timeout <ms> TCP connect timeout 5000
--https-timeout <ms> HTTPS request timeout 8000
--http-timeout <ms> HTTP request timeout 8000
--top <n> Keep only the top-N (by latency) in the output unlimited
--preview <n> Rows shown in the live table 50
--no-tcp Disable raw TCP probe
--no-https Disable HTTPS probe
--no-http Disable plain HTTP probe
--no-banner Don't print the startup banner
-q, --quiet Suppress live table; print only the final summary
-j, --json Print final JSON to stdout (implies --quiet)
-h, --help Show help
-v, --version Show version

Recipes

# Default scan with the bundled list
./netreach

# Bring your own targets
./netreach my-targets.txt

# HTTPS-only sweep (port 80 is dead on your network)
./netreach --no-tcp --no-http

# Quiet, top-50, JSON to a path
./netreach -q --top 50 -o working.json

# Stream JSON to stdout for piping
./netreach --top 100 -j | jq '[.[] | {ip, ms: .latency, cc: .country}]'

# Pessimistic timeouts for a very slow link
./netreach --tcp-timeout 10000 --https-timeout 15000 --http-timeout 15000 -c 80

๐Ÿ“Š Output format

result.json (or stdout with -j) is an array sorted by best latency:

[
  {
    "target": "vercel.com",
    "ip": "76.76.21.21",
    "country": "USA",
    "as_organization": "VERCEL-ASN",
    "latency": 87,
    "tcp": 87,
    "https": 308,
    "http": 301,
    "status": "OK"
  }
]
  • tcp โ€” TCP/443 handshake time in ms, or null if it failed.
  • https / http โ€” HTTP status code from the probe, or null if the request errored/timed out.
  • latency โ€” the minimum of all successful probe latencies.
  • status โ€” OK if at least one probe answered, FAIL otherwise.

๐Ÿง  How it works

   target โ”€โ–บ DNS โ”€โ”ฌโ”€โ–บ IP #1 โ”€โ”ฌโ”€โ–บ TCP/443 โ”€โ”
                  โ”‚          โ”œโ”€โ–บ HTTPS/443 โ”œโ”€โ–บ merge โ”€โ–บ row
                  โ”‚          โ””โ”€โ–บ HTTP/80  โ”€โ”˜
                  โ”œโ”€โ–บ IP #2 โ€ฆ
                  โ””โ”€โ–บ IP #n โ€ฆ

For each target, NetReach:

  1. Resolves it to all A records (or treats it as a literal IP).
  2. Spawns three concurrent probes per IP โ€” TCP, HTTPS-with-SNI, plain HTTP.
  3. Marks the row reachable if any probe succeeds.
  4. Enriches with offline GeoIP (country + ASN) from CIRCL's open data.
  5. Sorts everything by minimum latency and writes JSON.

All wrapped in a p-limit semaphore so 1900 targets stay polite at --concurrency 200.

๐Ÿ”ง Build from source

git clone https://github.com/WhoisGray/NetReach.git
cd NetReach
pnpm install
pnpm db          # download fresh GeoIP databases (~90 MB, not committed)
pnpm start       # run directly with Node
pnpm build       # produce a single-file SEA binary for this platform

Output:

dist/netreach-<platform>-<arch>[.exe]

๐Ÿชถ Why isn't the GeoIP data in git? Two 80 MB binary files would bloat the repo and go stale. CI re-downloads them on every release so users get the freshest geographic + ASN data possible. Locally, pnpm db (or node scripts/download-db.js) does the same.

Requirements

  • Node.js โ‰ฅ 20.12 built with the SEA fuse โ€” official builds from nodejs.org or nvm/fnm/volta. Homebrew's node does not ship with the fuse; the build script will scan your system and pick a compatible binary, or you can point at one explicitly:
    NODE_SEA_EXECUTABLE=/path/to/official/node pnpm build

๐Ÿšข Releasing

Tag and push โ€” CI handles the rest:

git tag v1.0.0
git push origin v1.0.0

The Release workflow builds for all 5 targets, zips each binary, and attaches them to a new GitHub Release with auto-generated notes. You can also kick it off manually from the Actions tab.

๐Ÿ—‚๏ธ Project layout

NetReach/
โ”œโ”€โ”€ .github/workflows/release.yml   CI: 5 platforms โ†’ zip โ†’ GitHub Release
โ”œโ”€โ”€ db/                             GeoIP data (mmdb files gitignored, fetched at build)
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ download-db.js              Fetches GeoIP DBs from CIRCL
โ”‚   โ””โ”€โ”€ build-sea.js                Single-binary SEA builder
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ banner.js                   ASCII art + tagline
โ”‚   โ”œโ”€โ”€ cli.js                      Argument parser + --help
โ”‚   โ”œโ”€โ”€ config.js                   Default settings
โ”‚   โ”œโ”€โ”€ assets.js                   SEA-aware asset loader
โ”‚   โ”œโ”€โ”€ targets.js                  Target file parsing
โ”‚   โ”œโ”€โ”€ dns.js                      DNS resolve + cache
โ”‚   โ”œโ”€โ”€ geoip.js                    Country + ASN lookup
โ”‚   โ”œโ”€โ”€ probes.js                   TCP, HTTPS, HTTP probes
โ”‚   โ”œโ”€โ”€ checker.js                  Per-IP probe orchestration
โ”‚   โ”œโ”€โ”€ display.js                  Live table renderer
โ”‚   โ””โ”€โ”€ runner.js                   Top-level orchestrator
โ”œโ”€โ”€ index.js                        Entry point
โ””โ”€โ”€ targets.txt                     ~1900 default targets (embedded in the binary)

๐Ÿค Contributing

PRs and issues welcome, especially:

  • New target categories (mirrors, package registries, AI APIs in $REGION).
  • Probe ideas โ€” QUIC? DoH? Native UDP? Open a discussion.
  • Telemetry-free improvements only. NetReach never phones home.

โš–๏ธ License

MIT โ€” do whatever, but don't blame me if your border router doesn't like it.

๐Ÿ™‹ Author

Built by WhoisGray.

If NetReach saved your evening, drop a โญ โ€” that's the only telemetry this project will ever have.