Skip to content

Gowee/chnroutes-cfworker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chnroutes-cfworker

Generate chnroutes by fetching RIR stats and managing to compressing routes by merging consecutive CIDRs, deployed on Cloudflare Workers. Ported from my Python script.

📢 The CIDR aggregator is now available as a standalone app: https://github.com/Gowee/cidr-aggregator 📢

API

Base URL: https://chnroutes-worker.bamboo.workers.dev 🔗

Generate Routes

  • Endpoint: /generate
  • Parameters:
    • countries
      • Comma-separated list of countries represented by 2 letters Country Code.
      • A leading ! indicates excluding all following countries. For example, !CN will cover all countries/regions except mainland China in registries specified below. A single ! indicates all countries. And so on...
    • registries
      • Comma-separated list of registries: AFRINIC, APNIC, ARIN, LACNIC, RIPE. Or All for all the five.
      • Excluding is not supported.
  • Examples:
    • https://chnroutes-worker.bamboo.workers.dev/generate?countries=CN&registries=APNIC 🔗
      • Typical chnroutes, useful for spliting traffic when bypassing the GFW with VPN/Proxies
      • Becasuse almost all of mainland China IPs are delegated to APNIC currently (Sep 2019), so it might be sufficient to only cover APNIC.
    • https://chnroutes-worker.bamboo.workers.dev/generate6?countries=US&registries=All 🔗
      • All U.S. IPv6s delegated to any registries.
      • The /generate6 endpoint is experimental and subject to change.

Deployment

  1. Make sure Rust and Cargo is installed.
  2. Download the project with git clone https://github.com/Gowee/chnroutes-cfworker.
  3. Install the CLI tool wrangler for deploying to CloudFlare workers.
  4. Configure and publish the worker following the official quickstart.

Credits

This repo takes rustwasm-worker-template, which is a project by Ashley Williams, as the base skeleton.

The name chnroutes comes from https://github.com/fivesheep/chnroutes.git.

About

chnroutes generator deployed on CloudFlare Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published