code wiki / _hdl_build / nx_capability_route.nx

nx_capability_route.nx

buildroot/runtime/_hdl_build/nx_capability_route.nx

3064 B51 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic capability
docsdependenciesstructsconstsfunctions

about

nx_capability_route.nx -- THE GLOBAL FUNCTIONALITY SPLIT (operator 2026-06-28: "global capabilities like mail or admin live on the .xxx.com [subdomain] ... the site visitors contents live on the forward slash off the root domain"). A PURE host-header classifier (NO syscalls, NO imports -> unit-gateable offline against crafted host strings, exactly like nx_sni_route): given a request Host, decide whether it is a CAPABILITY subdomain (mail.<d> / admin.<d> = the GLOBAL machinery, SAME for every domain) or CONTENT (<d> / www.<d> = the per-domain public site, served by PATH). The TLS-terminating front (the sites daemon) calls cr_capability per request: CR_CONTENT -> serve the per-domain docroot via the content router (nx_host_router hr_serve3), path-routed CR_ADMIN/MAIL -> reverse-proxy to the loopback capability daemon (the SAME pattern by which the sites daemon already reverse-proxies nx_status_daemon) Data-driven prefix table (Cardinal 11: add a capability = add a prefix row, no logic change). The actual reverse-proxy wiring into the sites daemon + running the loopback daemons + the *.<d> cert SANs are the operator-gated DEPLOY step; this is the routing DECISION, sovereign + proven. license_tier: ORIGINAL

dependencies 0 imports · 1 importers

nx_capability_route.nx nx_capability_route_gate.nx

imports: none

imported by: nx_capability_route_gate.nx

structs

none

consts

14const CR_CONTENT: i64 = 0 // <d> / www.<d> -> per-domain public site content (path-routed visitor content)
15const CR_ADMIN: i64 = 1 // admin.<d> -> the document-portal admin daemon (nx_docportal_admin_daemon)
16const CR_MAIL: i64 = 2 // mail.<d> -> the webmail daemon (nx_email_webmail_daemon)
19const CR_PORT_ADMIN: i64 = 8456
20const CR_PORT_MAIL: i64 = 8457

functions

24func cr_starts(host: *u8, hn: i64, prefix: *u8, pn: i64) -> i64
called by 1: cr_capability
40func cr_capability(host: *u8, hn: i64) -> i64
called by 1: cap_of calls 1: cr_starts
47func cr_backend_port(cap: i64) -> i64
called by 1: main