code wiki / (root) / nx_lib_httpd.nx

nx_lib_httpd.nx

buildroot/runtime/nx_lib_httpd.nx

4500 B107 linesdepth 7pulls 14 transitivereach 0 importersview sourcekind tooltopic lib
docsdependenciesstructsconstsfunctions

about

nx_lib_httpd.nx -- sovereign HTTP DAEMON for the nishi-library read API. Serves the READ PATH over the wire straight from nx_lib_store, RETIRING the Python serve.py endpoints + its SQLite. No python, no 3rd-party HTTP stack, no shell: raw sovereign sockets (nx_syscalls, pulled via nx_lib_serve -- so we do NOT import nx_syscalls_x86_64.nx = no sys_* double-emit) + the pure router nx_lib_http. GET /api/works -> JSON array of work_hks GET /api/work/<hk> -> JSON work record (200) or 404 license_tier: ORIGINAL | genealogy_id: nishi_library_sovereign_httpd_2026_06_30

dependencies 1 imports · 0 importers

nx_lib_http.nx nx_lib_httpd.nx

imports: nx_lib_http.nx

imported by: nobody (leaf or entry point)

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

main sys_socket sys_setsockopt lhd_sockaddr sys_bind sys_listen nx_lib_index_build nx_lib_store_index sys_mmap ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 nx_inv_new nx_lib_store_open ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ↻ ss_cat ↻ ss_loadfile sys_map_file ss_readall ↻ ss_load_aux2 sys_mmap ↻ ss_cat ↻ ss_loadfile ↻ ss_r32 ↻ sys_munmap ssl_total_keys ss_r32 ↻ ssl_pow2

structs

none

consts

12const LHD_AF_INET: i64 = 2
13const LHD_SOCK_STREAM: i64 = 1
14const LHD_SOL_SOCKET: i64 = 1
15const LHD_SO_REUSEADDR: i64 = 2
16const LHD_PORT: i64 = 8095
17const LHD_BACKLOG: i64 = 128
18const LHD_BUDGET: i64 = 1000000 // JPL-rule-2 bounded accept loop

functions

20func lhd_write_all(fd: i64, buf: *u8, n: i64) -> i64
called by 1: lhd_handle
33func lhd_handle(cfd: i64) -> i64
76func lhd_sockaddr(addr: *u8, port: i64) -> i64
called by 1: main
86func main() -> i64