code wiki / (root) / nx_http_loopback_gate.nx

nx_http_loopback_gate.nx

buildroot/runtime/nx_http_loopback_gate.nx

4571 B76 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic http
docsdependenciesstructsconstsfunctions

about

nx_http_loopback_gate.nx -- gates the sovereign HTTP client with a LIVE loopback GET against :8080. WHAT CHANGED, AND WHY (2026-08-01). This gate used to assert that :8080/blocklist answers 200 with the blocklist body. It has been RED since the topology changed: :8080 is redirect.elf, a plain-HTTP -> HTTPS redirector, and it 301s EVERY path unconditionally. Proven by hand with a raw socket carrying no Accept headers at all -- same 301 -- so the failure was never about the request we build. The old expectation was not just stale, it was backwards: serving that page in cleartext on :8080 is the thing we do NOT want. So the gate now asserts the redirect is present AND correct -- 301 with a Location that is https:// and carries the requested path. That turns a broken liveness check into a real transport-security check: if someone ever makes :8080 serve content directly, this goes RED. It still gates what it always gated -- nx_http_client builds a request that a live server accepts and answers -- because T1 needs real bytes back. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_http_client.nx nx_gate.nx nx_http_loopback_gate.nx

imports: nx_http_client.nxnx_gate.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gw sys_write nx_http_client_sockaddr_ip nx_http_client_get sys_socket nx_connect_bounded nx_fcntl sys_connect sys_mmap sys_poll sys_close sys_mmap ↻ nx_http_client_build_reque hc_put_caps sys_mmap ↻ nx_codec_caps_headers sys_mmap ↻ nx_codec_caps_accept_docum sys_mmap ↻ nx_codec_caps_accept_image nx_cc_put nx_codec_caps_accept_encod cc_encoding_have nx_cc_put ↻ cc_encoding_name nx_cc_put ↻ sys_write ↻ _drain sys_read gn sys_write ↻ sys_mmap ↻ hlg_atoi3 hlg_contains

structs

none

consts

none

functions

24func hlg_atoi3(buf: *u8, off: i64) -> i64 { var v: i64=0; var i: i64=0; while i<3 { let d: i64=buf[off+i] as i64; if d>=48 { if d<=57 { v=v*10+(d-48) } } i=i+1 } return v }
called by 1: main
25func hlg_contains(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main
33func main() -> i64