Expand description
Core domain types for proxy management.
§IP class and target compatibility
The 2026 scraping guide (see
docs/dev/project/scraping-guide-2026-llm-context.md §“PROXY PROVIDERS
AND TYPES”) ranks egress IPs into a four-tier trust hierarchy used by
every Tier-1 anti-bot vendor:
| Rank | IpClass | Typical use |
|---|---|---|
| 4 | Mobile | 3G/4G/5G carrier egress — defeats DataDome, PerimeterX, Kasada |
| 3 | Isp | Static/ISP allocation — defeats Akamai, Cloudflare, PerimeterX |
| 2 | Residential | Rotating residential pool — defeats most Tier-1 vendors |
| 1 | Datacenter | Hosted VPS / bare-metal — defeated by DataDome, PerimeterX |
| 0 | Unknown | Provider did not tag the egress — fail-secure default |
Each Proxy and ProxyCapabilities carries two typed fields that
drive capability-aware acquisition:
ip_class: IpClass— the proxy’s egress tier. Acquisition matches viaip_class.rank() >= requirement.rank()so aMobileproxy satisfies a request that requiresIsp.target_compatibility: TargetVendorCompatibility— aBTreeMap<VendorId, TrustTier>mapping each anti-bot vendor to a declared effectiveness tier. Free-list fetchers tag every ingested proxy asdefault_blocked()(no vendor confirmed) so callers cannot accidentally route premium traffic through a public free-list pool.
§Geo enrichment
Operators targeting specific cities / ASNs / postal codes — the
“Infatica-style city, ZIP, and ASN” filter cited by the 2026
scraping guide (L2837) — populate the optional
asn,
city, and
postal_code fields on
ProxyCapabilities. The corresponding
require_asn,
require_city, and
require_postal_code
fields on CapabilityRequirement select proxies whose geo
metadata matches. Empty requirement still matches any proxy (the
existing invariant is preserved).
use stygian_proxy::types::{CapabilityRequirement, ProxyCapabilities};
use stygian_proxy::types::well_known::KNOWN_ASN_CLOUDFLARE;
// Akamai scrape: insist the egress IP is in Cloudflare's AS.
let caps = ProxyCapabilities {
asn: Some(KNOWN_ASN_CLOUDFLARE),
city: Some("San Francisco".into()),
postal_code: Some("94110".into()),
..Default::default()
};
let req = CapabilityRequirement {
require_asn: Some(KNOWN_ASN_CLOUDFLARE),
require_city: Some("San Francisco".into()),
require_postal_code: Some("94110".into()),
..Default::default()
};
assert!(caps.satisfies(&req));use stygian_proxy::types::{IpClass, TargetVendorCompatibility, TrustTier, VendorId};
// A static-ISP proxy confirmed effective against Akamai and Cloudflare.
let compat = TargetVendorCompatibility::default()
.set(VendorId::Akamai, TrustTier::Preferred)
.set(VendorId::Cloudflare, TrustTier::Acceptable);
assert_eq!(compat.get(VendorId::Akamai), Some(TrustTier::Preferred));
assert_eq!(IpClass::Isp.rank(), 3);Modules§
- well_
known - Canonical ASN values for major public CDNs and infrastructure providers.
Structs§
- Capability
Requirement - Required capability set used as a filter when acquiring a proxy.
- IpClass
Requirement - Minimum
IpClassrequired for a capability-aware acquisition. - Proxy
- A proxy endpoint with optional authentication credentials.
- Proxy
Capabilities - Protocol-level capabilities advertised by a proxy endpoint.
- Proxy
Config - Configuration governing health checking and circuit-breaker behaviour.
- Proxy
Metrics - Per-proxy runtime metrics using lock-free atomic counters.
- Proxy
Record - A
Proxywith a stable identity and insertion timestamp. - Target
Vendor Compatibility - Mapping from anti-bot
VendorIdto the proxy’s declaredTrustTieragainst that vendor.
Enums§
- IpClass
- IP trust class for a proxy egress.
- Profiled
Request Mode - TLS-profiled request mode for proxy-side HTTP operations.
- Proxy
Type - The protocol variant of a proxy endpoint.
- Routing
Path - The protocol routing path resolved for an outbound request.
- Trust
Tier - Declared effectiveness of a proxy against a given anti-bot vendor.
- Vendor
Id - Anti-bot vendor identifier.
Constants§
- CITY_
MAX_ LEN - Maximum length of an operator-supplied
citystring. - POSTAL_
CODE_ MAX_ LEN - Maximum length of an operator-supplied
postal_codestring.
Functions§
- validate_
asn - Returns
Ok(())whenasnis a valid public Autonomous System Number, otherwise ancrate::error::ProxyError::InvalidGeoMetadatadescribing the failure. - validate_
city - Returns
Ok(())whencityis a valid operator-supplied city label, otherwise ancrate::error::ProxyError::InvalidGeoMetadata. - validate_
postal_ code - Returns
Ok(())whenpostal_codeis a valid operator-supplied postal / ZIP code, otherwise ancrate::error::ProxyError::InvalidGeoMetadata.