nx_http_redirect_daemon.nx
buildroot/runtime/bin/nx_http_redirect_daemon.nx
about
nx_http_redirect_daemon.nx -- sovereign plain-HTTP listener that
301-redirects everything to HTTPS. Pure Nishi, no TLS, no libc.
Operator 2026-05-28: "redirect the http to it" -- port 80 must send
browsers to https:// instead of landing on the Synology DSM (:5000).
Listens on 0.0.0.0:8080 (GL forwards public :80 here). For each
request it reads the start line + Host header and replies:
HTTP/1.0 301 Moved Permanently
Location: https://<host><path>
preserving the requested path so deep links survive the upgrade.
Public-exposure hardened (SO_RCVTIMEO/SNDTIMEO) + constant memory
(all buffers hoisted out of the accept loop) -- same discipline as
nx_sites_daemon (PREVENT: no sys_mmap in the loop).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_http_server.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
| 20 | const NX_RD_PORT: i64 = 8080 |
| 21 | const NX_RD_BUDGET: i64 = 100000000 |
functions
| 23 | func rd_find(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: main |
| 40 | func main() -> i64 |