code wiki / (root) / nx_audit_server_main.nx

nx_audit_server_main.nx

buildroot/runtime/nx_audit_server_main.nx

3097 B85 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind tooltopic audit
docsdependenciesstructsconstsfunctions

about

nx_audit_server_main.nx -- live phase-2 dashboard server. Composes the full phase-2 chain end-to-end (per NISHI_AUDIT_DASHBOARD_ROADMAP.md): nx_http_server -- bind/listen/accept on 127.0.0.1:8472 nx_pages_static -- file-backed route handler nx_path_canonicalize -- CWE-22 prevention at URL boundary Serves docs/audit/index.html under URL path /audit/index.html (plus snapshot.json under /audit/snapshot.json). Accepts ONE request then exits -- this is a deterministic bench probe, not a daemon. For daemon mode, caller wraps in a loop + supervisor (nx_supervisor.nx queued). Usage from bench/nx_pages_static_loopback.sh: ./nx_audit_server & curl http://127.0.0.1:8472/audit/index.html | diff - docs/audit/index.html wait expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls_x86_64.nx nx_http_server.nx nx_pages_static.nx nx_audit_server_main.nx

imports: nx_syscalls_x86_64.nxnx_http_server.nxnx_pages_static.nx

imported by: nobody (leaf or entry point)

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

main nx_http_server_addr_loopba nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen nx_http_server_accept_one sys_accept nx_http_server_read_reques sys_read nx_http_parse_request nx_pages_serve_file nx_pages_emit_405 nxpg_put_cstr nxpg_put nx_pages_emit_404 nxpg_put_cstr ↻ sys_mmap ↻ nx_path_canonicalize nxp_is_dotdot_segment nx_pages_emit_403 nxpg_put_cstr ↻ nx_path_join nx_pages_emit_500 nxpg_put_cstr ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read ↻ sys_close ↻ nx_pages_mime_from_path nxpg_ends_with_5 nxpg_ends_with_4

structs

none

consts

28const NX_AUDIT_PORT: i64 = 51847
29const NX_AUDIT_REQ_CAP: i64 = 8192
30const NX_AUDIT_RESP_CAP: i64 = 524288 // 512 KB (dashboard HTML ~13 KB)

functions

32func main() -> i64