nx_pages_daemon.nx
buildroot/runtime/nx_pages_daemon.nx
about
nx_pages_daemon.nx -- D1.2 of NISHI_DEPLOY_ROADMAP. Composes
nx_http_server (socket+accept) + http_parse (full request parse) +
nx_pages_vhost (Host-header routing) + nx_pages_static (file serving)
into a single accept-loop daemon. HTTP-only in this stone;
TLS/HTTPS lands in D1.3.
Build (x86_64 native Linux ELF, static):
cd nishi-core/nxc2
./nxc2.exe --target x86_64 runtime/nx_pages_daemon.nx > /tmp/d.s
wsl bash -c "as /tmp/d.s -o /tmp/d.o && ld /tmp/d.o -o nx_pages_daemon"
Run:
./nx_pages_daemon # listens on :8080 (config hardcoded V1)
V1 limitations (each named so they can become D1.x sub-stones):
- port + vhost map are hardcoded; D1.6 adds config file
- single-threaded accept loop; D1.10 adds worker pool
- no keepalive; D1.x adds HTTP/1.1 persistent connections
- no TLS; D1.3
- no SIGHUP reload; D1.6
- no ACME loop; D1.5
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_http.nxnx_http_server.nxnx_pages_vhost.nxnx_pages_static.nxnx_pages_config.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
| 29 | const NX_MAGIC_2048: i64 = 2048 |
| 30 | const NX_MAGIC_4096: i64 = 4096 |
| 32 | const NX_DAEMON_PORT: i64 = 18080 |
| 33 | const NX_DAEMON_BACKLOG: i64 = 128 |
| 34 | const NX_DAEMON_REQ_CAP: i64 = 16384 |
| 35 | const NX_DAEMON_RESP_CAP: i64 = 4194304 // 4 MB max response (covers WASM) |
| 36 | const NX_DAEMON_HTTP_METHOD_GET: i64 = 1 |
functions
| 43 | func _daemon_setup_vhosts_hardcoded(t: *NxVHostTable, cursor: *i64) -> i64 |
| 61 | func _daemon_setup_vhosts(t: *NxVHostTable, cursor: *i64) -> i64 |
| 100 | func _daemon_serve_one(cfd: i64, table: *NxVHostTable) -> i64 called by 1: main calls 9: sys_mmapsys_readsys_closehttp_parsenx_pages_emit_405nx_http_server_send_response+3 |
| 169 | func main() -> i64 |