cf-colo-hint

Crates.iocf-colo-hint
lib.rscf-colo-hint
version0.1.332
created_at2025-12-15 23:25:46.060445+00
updated_at2026-01-26 00:38:25.873508+00
descriptionCloudflare colo to Durable Objects location hint mapping
homepage
repositoryhttps://github.com/connyay/cf-colo-hint
max_upload_size
id1986957
size458,071
Connor Hindley (connyay)

documentation

README

cf-colo-hint

A Rust library that maps Cloudflare edge locations (colos) to Durable Objects location hints.

Usage

use cf_colo_hint::{Colo, LocationHint};

// Parse a colo from the cf-ray header or request metadata
let colo = Colo::from_code("LAX").expect("unknown colo");

// Get the recommended location hint for Durable Objects
if let Some(hint) = colo.location_hint() {
    println!("Use location hint: {}", hint.as_str());
}

// Work with location hints directly
let hint = LocationHint::WNam;
assert_eq!(hint.as_str(), "wnam");
assert_eq!(hint.name(), "Western North America");

Features

  • no_std compatible
  • Zero dependencies
  • Auto-generated from Cloudflare's status page and measured latency data

Data Sources

Colo data is sourced from:

Updating Data

Run the refresh script to pull the latest data and regenerate the Rust code:

./refresh.sh

License

MIT

Commit count: 338

cargo fmt