code wiki / _hdl_build / nx_proxy_route.nx

nx_proxy_route.nx

buildroot/runtime/_hdl_build/nx_proxy_route.nx

7032 B144 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_proxy_route.nx -- SOVEREIGN data-driven PROXY route table (pure Nishi, no TLS, no crypto). The DYNAMIC-routing analog of nx_host_router's static docroot table: a config file maps (host, path-prefix) -> (backend_port, mode) so an app/site route is a CONFIG ROW, not a recompiled `sd2_contains(" /gallery")` branch in the TLS daemon. This closes the nx_host_router gap for DYNAMIC routes -> "migrate a bunch of sites" becomes add-a-row, zero recompile. SOTA basis: reverse-proxy / API-gateway route tables reloadable without rebuild (knowledge/fetched/plat_reverse_proxy.raw, plat_api_mgmt.raw); see knowledge/research/2026-06-29-platform-sclass-exceed-standard.md. license_tier: ORIGINAL Config line: "<host|*> <path-prefix> <backend_port> <mode>" ('#' = comment, blank lines ok) host exact (case-insensitive) or '*' wildcard; exact host wins over '*' path-prefix request-line path prefix, boundary-safe (/gen matches /gen,/gen/,/gen?x NOT /generated) backend_port loopback 127.0.0.1:<port> to reverse-proxy to mode buffered (default,0) | stream (1) | gated (2) Match rule: among all rows whose host+prefix match, LONGEST prefix wins; tie -> exact host beats '*'.

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_proxy_route.nx nx_proxy_route_gate.nx nx_sites_daemon_v2.nx

imports: nx_syscalls.nx

imported by: nx_proxy_route_gate.nxnx_sites_daemon_v2.nx

structs

none

consts

18const PR_MODE_BUFFERED: i64 = 0
19const PR_MODE_STREAM: i64 = 1
20const PR_MODE_GATED: i64 = 2

functions

22func pr_lower(c: u8) -> u8
called by 1: pr_ieq
28func pr_ieq(a: *u8, b: *u8, n: i64) -> i64
called by 1: pr_lookup calls 1: pr_lower
34func pr_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: pr_word
37func pr_word(s: *u8, n: i64, lit: *u8) -> i64
called by 1: pr_mode calls 1: pr_strlen
45func pr_parse_u(s: *u8, n: i64) -> i64
called by 1: pr_lookup
56func pr_mode(s: *u8, n: i64) -> i64
called by 1: pr_lookup calls 1: pr_word
64func pr_path_pref(path: *u8, pn: i64, pref: *u8, prefn: i64) -> i64
called by 1: pr_lookup
80func pr_lookup(cfg: *u8, cfgn: i64, host: *u8, hn: i64, path: *u8, pn: i64, out_port: *i64, out_mode: *i64) -> i64