code wiki / _hdl_build / nx_aw_tlsproxy.nx
nx_aw_tlsproxy.nx
buildroot/runtime/_hdl_build/nx_aw_tlsproxy.nx
about
nx_aw_tlsproxy.nx -- SOVEREIGN TLS reverse proxy: terminates HTTPS (TLS 1.3 + the real Let's Encrypt cert,
reusing the PROVEN nx_tls13_server_session stack from nx_sites_daemon) on its own port, then forwards the
decrypted HTTP request to the LOOPBACK CMS admin (127.0.0.1:8456, plain HTTP) and relays the admin's
response back encrypted. This puts the andelinwest lawyer/client admin behind real TLS WITHOUT modifying
the live sites_v2 daemon and WITHOUT re-porting the TLS stack into the plain-HTTP admin (operator chose
Approach A; standalone for small blast radius + instant DNAT-flip rollback). Live cutover = point the
.240:443 DNAT at NX_TP_PORT. Fork-per-connection (bounded). license_tier: ORIGINAL
argv[1] (optional) = listen port (default 9443); argv[2] (optional) = backend port (default 8456)
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_csprng.nxnx_http_server.nxnx_tls13_server_session.nxnx_tls13_server_session_run.nxnx_tls13_server_session_app_data.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
| 16 | const NX_MAGIC_100000000: i64 = 100000000 |
| 18 | const NX_TP_PORT_DEFAULT: i64 = 9443 |
| 19 | const NX_TP_BACKEND_DEFAULT: i64 = 8456 |
| 20 | const NX_TP_CERT: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_fullchain.der" as *u8 |
| 21 | const NX_TP_PRIV: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_ecdsa_key.bin" as *u8 |
| 22 | const NX_TP_MAX_CHILDREN: i64 = 64 |
| 23 | const NX_TP_REC: i64 = 20480 |
| 24 | const NX_TP_RESP: i64 = 262144 |
| 25 | const NX_TP_OUTCAP: i64 = 32768 |
| 26 | const NX_TP_CHUNK: i64 = 15000 |
functions
| 28 | func tp_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 31 | func tp_backend(bport: i64, req: *u8, req_n: i64, resp: *u8, cap: i64) -> i64 |
| 53 | func main(argc: i64, argv: *i64) -> i64 |