nx_lib_httpd.nx
buildroot/runtime/nx_lib_httpd.nx
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
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
structs
| none |
consts
| 12 | const LHD_AF_INET: i64 = 2 |
| 13 | const LHD_SOCK_STREAM: i64 = 1 |
| 14 | const LHD_SOL_SOCKET: i64 = 1 |
| 15 | const LHD_SO_REUSEADDR: i64 = 2 |
| 16 | const LHD_PORT: i64 = 8095 |
| 17 | const LHD_BACKLOG: i64 = 128 |
| 18 | const LHD_BUDGET: i64 = 1000000 // JPL-rule-2 bounded accept loop |
| 60 | const LHD_REQ_CAP: i64 = 131072 |
| 61 | const LHD_OUT_CAP: i64 = 1200000 |
functions
| 20 | func lhd_write_all(fd: i64, buf: *u8, n: i64) -> i64 called by 1: lhd_handle |
| 63 | func lhd_reqbuf() -> *u8 { if LHD_REQ_BUF == 0 { LHD_REQ_BUF = sys_mmap(LHD_REQ_CAP) as i64 } return LHD_REQ_BUF as *u8 } called by 1: lhd_handle |
| 65 | func lhd_outbuf() -> *u8 { if LHD_OUT_BUF == 0 { LHD_OUT_BUF = sys_mmap(LHD_OUT_CAP) as i64 } return LHD_OUT_BUF as *u8 } called by 1: lhd_handle |
| 67 | func lhd_handle(cfd: i64) -> i64 called by 1: main calls 6: lhd_reqbuflhd_outbuflhd_responselhd_write_alllhd_startslhd_ingest_response |
| 110 | func lhd_sockaddr(addr: *u8, port: i64) -> i64 called by 1: main |
| 120 | func main() -> i64 |