code wiki / (root) / nx_browse_text.nx

nx_browse_text.nx

buildroot/runtime/nx_browse_text.nx

6465 B184 linesdepth 5pulls 8 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_browse_text.nx -- production-shaped browser fetch entry point. Compose: TCP connect → send HTTP GET → drain response → HTTP-parse → HTML→text → caller-owned buffer. This is the actual callable API the sovereign browser exposes for text-mode page fetch. Distinct from nx_https_get (HTTPS path is gated on the X.509 chain-validation arc, queued separately). This module ships the PLAINTEXT HTTP/1.1 path because every piece it depends on is already proven (TCP loopback works, nx_http_response_parse passes 6 KATs, nx_html_to_text passes 6 KATs). CAPABILITY_COMPLETENESS: PARTIAL. MISSING_CAPABILITIES: - TLS (separate nx_https_get arc, depends on X.509 chain validation) - Redirect following (3xx Location header) - Chunked transfer dechunking before render - gzip / deflate Content-Encoding - HTTP/2 + HTTP/3 Per [[feedback-no-skip-paths-as-error-codes]] these are named follow-on arcs, NOT silent gaps. Built per F7 post-order DFS: callees defined before callers. expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 6 importers

nx_syscalls.nx nx_connect.nx nx_http_response_parse.nx nx_html_to_text.nx nx_browse_text.nx _inet_fetch_authored.nx _inet_naive_probe.nx nx_browse_text_test.nx nx_library_search_test.nx nx_research_fetch_test.nx nx_research_resilience_test.nx

imports: nx_syscalls.nxnx_connect.nxnx_http_response_parse.nxnx_html_to_text.nx

imported by: _inet_fetch_authored.nx_inet_naive_probe.nxnx_browse_text_test.nxnx_library_search_test.nxnx_research_fetch_test.nxnx_research_resilience_test.nx

structs

none

consts

32const NX_MAGIC_4096: i64 = 4096
36const NX_BR_OK: i64 = 0
37const NX_BR_SOCKET_FAIL: i64 = 1
38const NX_BR_CONNECT_FAIL: i64 = 2
39const NX_BR_SEND_FAIL: i64 = 3
40const NX_BR_RECV_FAIL: i64 = 4
41const NX_BR_PARSE_FAIL: i64 = 5
42const NX_BR_STATUS_FAIL: i64 = 6
43const NX_BR_OVERFLOW: i64 = 7

functions

47func br_addr_ipv4(out: *u8, a: i64, b: i64, c: i64, d: i64, port: i64) -> i64
57func br_drain(fd: i64, buf: *u8, cap: i64) -> i64
called by 1: br_fetch_raw calls 1: sys_read
72func br_build_get(
called by 1: br_fetch_raw
121func br_fetch_raw(
148func br_render_response(
172func nx_browse_text(