Skip to main content

is_cn

Function is_cn 

Source
pub async fn is_cn() -> bool
Expand description

Do the best to guess whether the access point is in China Mainland or not.

Detection priority:

  1. LONGBRIDGE_REGION environment variable (takes precedence).
  2. LONGPORT_REGION environment variable (fallback alias).
  3. Process-wide cached result from a previous probe.
  4. Live HTTP probe to https://geotest.lbkrs.com — HTTP 200 → CN, anything else (error or non-200) → not CN.