nx_iot_hub_serve.nx
buildroot/runtime/nx_iot_hub_serve.nx
about
nx_iot_hub_serve.nx -- the sovereign IoT HUB HTTP server (killer-feature rung 3).
Operator vision: manage the house's IoT entirely from the FIRST-PARTY NISHI BROWSER, LAN-only,
available even with the internet out. This is the always-on hub surface: it renders the zero-JS
dashboard (nx_iot_dashboard) on GET / and accepts the control POSTs on /home/cmd -- all over the
LAN, no cloud. Composes the proven nx_http_server (bind/listen/accept + parse + respond) so there
is NO new protocol code. Like nx_vizsla_serve: a bare run prints usage; `serve <port>` runs the
accept loop; `handle <reqfile>` processes one captured request (GATEABLE without sockets).
Rung 2 will wire /home/cmd to the Nishi Tuya-LAN client (TCP/6668 + AES + local_key). For now the
command is parsed + acknowledged (303-style 200) so the full browser->hub loop is provable today.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_http_server.nxnx_iot_dashboard.nx
imported by: nx_iot_hub_serve_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const HUB_MAGIC_18099: i64 = 18099 |
| 17 | const HUB_REQ_CAP: i64 = 8192 |
| 18 | const HUB_PAGE_CAP: i64 = 262144 |
functions
| 20 | func hub_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 23 | func hub_match(req: *u8, off: i64, len: i64, lit: *u8) -> i64 |
| 34 | func hub_ct_html(box: *u8) -> i64 |
| 42 | func hub_serve_client(cfd: i64, page: *u8, page_n: i64) -> i64 |
| 71 | func main(argc: i64, argv: *i64) -> i64 |