code wiki / _hdl_build / nx_cleanwatch_serve.nx
nx_cleanwatch_serve.nx
buildroot/runtime/_hdl_build/nx_cleanwatch_serve.nx
about
nx_cleanwatch_serve.nx -- HANDS-ON, REAL: the operator enters ANY site; we fetch it over our own sovereign TLS,
harvest its ACTUAL resource URLs, and run nx_web_filter over them -- showing the real ad/tracker/miner/popunder
requests THAT page makes that we'd block. Real evidence on real sites, not a canned list. Bind 0.0.0.0 -> WSL2
forwards Windows localhost (same path as nx_browser_view_serve). Run from nxc2 root (certdata is relative).
Honest scope: static fetch shows resources in the delivered HTML; URLs the page builds via JS at runtime need
the JS-exec sniffer layer (noted in the report). Run: nx_cleanwatch_serve [port] license_tier: ORIGINAL
dependencies 8 imports · 0 importers
imports: nx_syscalls.nxnx_http_server.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_media_signal.nxnx_web_filter.nxnx_video_sniff.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 15 | const K_MAGIC_1048576: i64 = 1048576 |
| 16 | const K_MAGIC_4194304: i64 = 4194304 |
| 17 | const K_MAGIC_262144: i64 = 262144 |
| 18 | const K_MAGIC_4096: i64 = 4096 |
| 19 | const K_MAGIC_4095: i64 = 4095 |
| 20 | const K_MAGIC_8100: i64 = 8100 |
| 21 | const K_MAGIC_16384: i64 = 16384 |
| 22 | const K_MAGIC_65536: i64 = 65536 |
functions
| 24 | func cw_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 25 | func cw_put(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off } |
| 26 | func cw_putn(dst: *u8, off: i64, v: i64) -> i64 { var m: i64=v; if m==0 { dst[off]=48 as u8; return off+1 } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } var j: i64=0; while j<k { dst[off]=t[k-1-j]; off=off+1; j=j+1 } return off } |
| 27 | func cw_datoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while (s[i]&0xff)>=48 { if (s[i]&0xff)>57 { i=i } else { v=v*10+((s[i]&0xff)-48); i=i+1 } if (s[i]&0xff)<48 { i=i } } return v } |
| 28 | func cw_hexval(c: i64) -> i64 { if c>=48 { if c<=57 { return c-48 } } if c>=97 { if c<=102 { return c-87 } } if c>=65 { if c<=70 { return c-55 } } return 0 } called by 1: cw_query_url |
| 29 | func cw_dstarts(p: *u8, plen: i64, pre: *u8) -> i64 { var i: i64=0; while pre[i]!=(0 as u8) { if i>=plen { return 0 } if (p[i]&0xff)!=(pre[i]&0xff) { return 0 } i=i+1 } return 1 } called by 1: cw_home |
| 31 | func cw_esc(dst: *u8, off: i64, s: *u8, sl: i64) -> i64 calls 1: cw_put |
| 39 | func cw_query_url(q: *u8, qlen: i64, out: *u8, cap: i64) -> i64 |
| 50 | func cw_delim(c: i64) -> i64 { if c==34{return 1} if c==39{return 1} if c==32{return 1} if c==60{return 1} if c==62{return 1} if c==41{return 1} if c==125{return 1} if c==93{return 1} if c==92{return 1} if c==10{return 1} if c==9{return 1} if c==13{return 1} return 0 } |
| 51 | func cw_contains(hay: *u8, hl: i64, needle: *u8, nl: i64) -> i64 { if nl==0 {return 1} if nl>hl {return 0} var i: i64=0; let last: i64=hl-nl; while i<=last { var j: i64=0; var m: i64=1; while j<nl { if (hay[i+j]&0xff)!=(needle[j]&0xff){m=0;j=nl} else {j=j+1} } if m==1 {return 1} i=i+1 } return 0 } |
| 53 | func send_html(cfd: i64, body: *u8, blen: i64) -> i64 |
| 60 | func cw_head(page: *u8, o: i64) -> i64 |
| 64 | func cw_home(page: *u8) -> i64 called by 1: cw_home calls 10: cw_headcw_putcw_dstartsnx_http_server_accept_onesys_mmapnx_http_server_read_request+4 |
| 73 | func cw_analyze(cfd: i64, t: *i64, store: *TrustStore, url: *u8, ulen: i64) -> i64 |
| 154 | func main(argc: i64, argv: *i64) -> i64 |