code wiki / _hdl_build / nx_galx_bridge.nx
nx_galx_bridge.nx
buildroot/runtime/_hdl_build/nx_galx_bridge.nx
about
nx_galx_bridge.nx -- SOVEREIGN reverse-tunnel bridging the WSL-workstation gallery to the always-on NAS.
The gallery runs on the workstation (WSL2-NAT'd -> NOT LAN-reachable). Instead of netsh/ssh, the workstation
DIALS OUT to the NAS (outbound traverses the NAT); the NAS routes nishifamily.com/gallery requests back down
those pooled connections to the workstation, which forwards them to the local OPAQUE gateway -> gallery.
Pure sockets (sys_socket/connect/bind/listen/accept/read/write/fork) -- NO sh, NO netsh, NO ssh.
NAS mode: nx_galx_bridge nas <tunnel_port> <front_port>
listen tunnel_port (workstation dials IN -> conns wait in the accept backlog = the pool) + front_port
(the NAS TLS front sends /gallery requests here, loopback). Per front request: fork -> accept one pooled
worker -> forward request -> relay worker->front until close.
WS mode: nx_galx_bridge ws <a> <b> <c> <d> <tunnel_port> <gateway_port> <pool>
fork <pool> dialers; each loops: connect <a.b.c.d>:tunnel_port -> read the routed request -> connect
127.0.0.1:gateway_port (the OPAQUE gateway) -> forward -> relay gateway->tunnel until close -> reconnect.
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_connect.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
| 15 | const K_MAGIC_65536: i64 = 65536 |
| 16 | const K_MAGIC_1000000000: i64 = 1000000000 |
| 17 | const K_MAGIC_131072: i64 = 131072 |
| 18 | const K_MAGIC_3600: i64 = 3600 |
functions
| 20 | func gb_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{return v} if c>57{return v} v=v*10+(c-48); i=i+1 } return v } called by 1: main |
| 23 | func gb_connect(a: i64, b: i64, c: i64, d: i64, port: i64) -> i64 |
| 33 | func gb_listen(port: i64) -> i64 |
| 46 | func gb_relay(src: i64, dst: i64) -> i64 |
| 52 | func main(argc: i64, argv: *i64) -> i64 |