code wiki / _hdl_build / nx_site_dispatch.nx
nx_site_dispatch.nx
buildroot/runtime/_hdl_build/nx_site_dispatch.nx
about
nx_site_dispatch.nx -- the RECONCILED sites daemon's BRAIN: the complete, PURE, DATA-DRIVEN per-request
decision that REPLACES the hardcoded if-cascade + the hardcoded cert + the hardcoded vhost list. Composes the
three gated cores: cert = cr_match(SNI host) [nx_cert_registry] ; if an app ROUTE matches -> PROXY(port,mode)
[nx_route_table] ; else if the host is a known VHOST -> SERVE_STATIC(docroot) ; else -> 404. NO hardcoded
routes/certs/hosts -- all three are DATA TABLES (proxy_routes.conf / certs_generated.conf / sites.conf, all
emitted by nx_domain_forge). The TLS/socket transport (io) is a thin shell over THIS. Operator: "fix all the
hardcoding ... s-class exceed ... append a domain and the builders emit it." license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_route_table.nxnx_cert_registry.nx
imported by: nx_site_dispatch_gate.nxnx_site_handler.nx
structs
| none |
consts
| 11 | const SD_PROXY: i64 = 0 // an app route matched -> reverse-proxy to (port, mode) |
| 12 | const SD_STATIC: i64 = 1 // no app route, but the host is a provisioned vhost -> serve its docroot |
| 13 | const SD_NOTFOUND: i64 = 2 // unknown host/path -> 404 (fail-closed; never a wrong backend) |
functions
| 16 | func sd_vhost(vt: *u8, n: i64, host: *u8, hn: i64, drbuf: *u8) -> i64 |
| 39 | func sd_dispatch(rt: *u8, rtn: i64, ct: *u8, ctn: i64, vt: *u8, vtn: i64, sni: *u8, shn: i64, host: *u8, hn: i64, path: *u8, pn: i64, port_out: *i64, mode_out: *i64, chainbuf: *u8, keybuf: *u8, drbuf: *u8) -> i64 |