nx_browser_fetch.nx
buildroot/runtime/nx_browser_fetch.nx
about
nx_browser_fetch.nx -- the practical render-front fetch: browser headers (nx_https_get_spoof: real Firefox UA
+ Accept) AND redirect-following, which neither existing fetch did together. This is what actually retrieves
media from real hosts -- they UA-gate non-browser clients AND 301 to a CDN. bf_fetch_follow loops the spoof
GET across 3xx Location redirects (bounded), returning the final raw response. For HARD hosts (Cloudflare-grade
TLS-fingerprint + JS challenges) the full Nishi-browser render is still needed -- but this covers the common
case (abandonware / niche sites, which are rarely behind advanced bot-walls). license_tier: ORIGINAL
dependencies 3 imports · 8 importers
imports: nx_syscalls.nxnx_x509_trust_store.nxnx_https_get_spoof.nx
imported by: nx_archive_daemon.nxnx_bench_warc.nxnx_bf_live.nxnx_crawl_preserve.nxnx_ia_resolve.nxnx_meta_refresh_gate.nxnx_preserve_live.nxzz_bf.nx
structs
| none |
consts
| 10 | const K_MAGIC_8192: i64 = 8192 |
functions
| 12 | func bf_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 13 | func bf_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64 |
| 20 | func bf_status(resp: *u8, n: i64) -> i64 { if n < 12 { return 0 } return (((resp[9]&0xff)-48)*100) + (((resp[10]&0xff)-48)*10) + ((resp[11]&0xff)-48) } |
| 22 | func bf_location(resp: *u8, n: i64, out: *u8, cap: i64) -> i64 |
| 34 | func bf_fetch_follow(url: *u8, store: *TrustStore, cr: *u8, pk: *u8, now: i64, out: *u8, cap: i64, maxredir: i64) -> i64 |
| 62 | func bf_body_off(resp: *u8, n: i64) -> i64 { let p: i64 = bf_find(resp, n, "\r\n\r\n" as *u8, 4, 0); if p < 0 { return 0 } return p + 4 } |
| 64 | func bf_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: bf_ci_find |
| 66 | func bf_ci_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64 |
| 75 | func bf_meta_refresh(html: *u8, hlen: i64, out: *u8, cap: i64) -> i64 |
| 102 | func bf_fetch_meta(url: *u8, store: *TrustStore, cr: *u8, pk: *u8, now: i64, out: *u8, cap: i64, maxhops: i64) -> i64 |