code wiki / (root) / nx_https_get_cli2_candidate.nx

nx_https_get_cli2_candidate.nx

buildroot/runtime/nx_https_get_cli2_candidate.nx

18045 B355 linesdepth 20pulls 130 transitivereach 1 importersview sourcekind tooltopic https
docsdependenciesstructsconstsfunctions

about

nx_https_get_cli2.nx -- CANARY of the sovereign HTTPS fetch with HELLO AUTO-FALLBACK (seq759 design, finally real). nx_https_get <url> [connect-host:port] WHY THIS EXISTS (measured 2026-07-25): the live chrome-ONLY build regressed every host that rejects the Chrome-mimic hello but accepts our plain minimal hello (api.nhtsa.gov proven 200 on 07-23, verdict=5 now; same class: www.sec.gov, efts.sec.gov, www.justice.gov). Cloudflare-walled hosts (api.worldbank.org) still NEED the chrome hello. No single hello serves both sets, so: attempt 1 = chrome-JA3 (identical to live behavior for every currently-working feed), on handshake failure reconnect and attempt 2 = plain hello. Fallback is LEGIBLE (stderr nishi-hello line, never a silently-different code path). license_tier: ORIGINAL

dependencies 13 imports · 1 importers

nx_syscalls.nx nx_http_response_parse_candidate.n nx_connect.nx nx_csprng.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_tls13_chrome_session.nx nx_https_url_for_fetch.nx nx_https_get_cli2_candidate.nx nx_https_get_cli2_body_gate.nx

diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_http_response_parse_candidate.nxnx_connect.nxnx_csprng.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_tls13_chrome_session.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get_complete.nxnx_tls_cert_cache.nx

imported by: nx_https_get_cli2_body_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main hgc_put sys_write hgc_slen sys_now_realtime_sec sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_clock_gettime_real nx_trust_store_load_from_c sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space

structs

none

consts

22const HGC_MAGIC_4194304: i64 = 4194304
23const HGC_MAGIC_65535: i64 = 65535
25const HGC_CERTDATA: *u8 = "data/mozilla_certdata.txt" as *u8
26const HGC_OUTCAP: i64 = 4194304 // 4 MiB response cap
31const HGC_XHDR_CAP: i64 = 8192
85const HGC_HDR_ERR_NOCOLON: i64 = 0 - 1
86const HGC_HDR_ERR_CTLBYTE: i64 = 0 - 2
87const HGC_HDR_ERR_CAPACITY: i64 = 0 - 3

functions

28func hgc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 3: mainhgc_puthgc_put2
32func hgc_put(s: *u8) -> i64 { sys_write(1, s, hgc_slen(s)); return 0 }
called by 2: mainmain calls 2: sys_writehgc_slen
33func hgc_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
47func hgc_put2(s: *u8) -> i64 { sys_write(2, s, hgc_slen(s)); return 0 }
called by 1: main calls 2: sys_writehgc_slen
48func hgc_putn2(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
88func hgc_build_xhdr(v: *u8, out: *u8) -> i64
called by 2: mainmain
106func hgc_streq(a: *u8, b: *u8) -> i64
called by 1: main
113func hgc_hexval(c: i64) -> i64
120func hgc_hdr_end(b: *u8, n: i64) -> i64
called by 2: mainmain
131func hgc_hdr_chunked(b: *u8, n: i64, he: i64) -> i64
called by 2: mainmain calls 1: _gc_ci_match
157func hgc_dechunk(src: *u8, n: i64, out: *u8) -> i64
called by 2: mainmain calls 1: nx_http_dechunk
161func main(argc: i64, argv: *i64) -> i64
328func hgc_parse_ipport(s: *u8, ip_out: *i64, port_out: *i64) -> i64
called by 1: main