code wiki / _hdl_build / nx_aw_tlsproxy.nx

nx_aw_tlsproxy.nx

buildroot/runtime/_hdl_build/nx_aw_tlsproxy.nx

7036 B143 linesdepth 14pulls 68 transitivereach 0 importersview sourcekind tooltopic aw
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_connect.nx nx_csprng.nx nx_http_server.nx nx_tls13_server_session.nx nx_tls13_server_session_run.nx nx_tls13_server_session_app_data.n nx_aw_tlsproxy.nx

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

main tp_atoi sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_write nx_http_server_addr_any nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap ↻ sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close ↻ sys_listen sys_set_socket_timeout sys_mmap ↻ sys_setsockopt ↻ sys_munmap sys_wait4 sys_accept_with_addr sys_fork sys_close ↻ sys_setsockopt ↻ nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_tls13_server_session_ru nx_tls13_server_session_ne sys_mmap ↻ x25519_keypair_public

structs

none

consts

16const NX_MAGIC_100000000: i64 = 100000000
18const NX_TP_PORT_DEFAULT: i64 = 9443
19const NX_TP_BACKEND_DEFAULT: i64 = 8456
20const NX_TP_CERT: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_fullchain.der" as *u8
21const NX_TP_PRIV: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_ecdsa_key.bin" as *u8
22const NX_TP_MAX_CHILDREN: i64 = 64
23const NX_TP_REC: i64 = 20480
24const NX_TP_RESP: i64 = 262144
25const NX_TP_OUTCAP: i64 = 32768
26const NX_TP_CHUNK: i64 = 15000

functions

28func 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
31func tp_backend(bport: i64, req: *u8, req_n: i64, resp: *u8, cap: i64) -> i64
53func main(argc: i64, argv: *i64) -> i64