code wiki / (root) / nx_https_fetch_follow.nx

nx_https_fetch_follow.nx

buildroot/runtime/nx_https_fetch_follow.nx

45204 B761 linesdepth 20pulls 145 transitivereach 365 importersview sourcekind librarytopic https
docsdependenciesstructsconstsfunctions

about

nx_https_fetch_follow.nx -- Fetcher upgrade F-2: LIVE redirect-following fetch. Composes the proven sovereign TLS-1.3 fetch sequence (url_for_fetch -> connect -> client_session_run -> get_complete -> response_parse) with F-1's redirect logic (nx_https_redirect) in a bounded loop: on a 3xx with Location, re-fetch the new URL up to max_hops. 100% sovereign (nx_cc->nxasm, own TLS); the only non-Nishi inputs are the CA-root DATA + the fetched pages. API: nx_https_fetch_follow(url, store, out, out_cap, max_hops, out_status) -> POSITIVE body_bytes (final non-redirect response, dechunked into out) | NEGATIVE -code on failure. out_status[0] = final HTTP status. nx_safety_envelope: intended_use: sovereign web fetcher (live network) sil_target: SIL1 verdict: NOT_YET_EVALUATED genealogy_id: ietf/rfc_9110+9112 lineage_id: nx_https_fetch_follow_v1

dependencies 15 imports · 241 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_https_url_for_fetch.nx nx_https_url_connect.nx nx_https_get_complete.nx nx_tls13_chrome_session.nx nx_http_response_parse.nx nx_https_redirect.nx nx_https_fetch_follow.nx nx_4chan.nx nx_access_research_fetch.nx nx_adnet_research_fetch.nx nx_agentcap_sota_fetch.nx nx_aimode_lib.nx nx_apertus_mirror_nas.nx nx_apertus_shards_pull.nx nx_apertus_smallfiles.nx nx_apertus_tree_fetch.nx nx_api_sota_fetch.nx

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

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get_complete.nxnx_tls13_chrome_session.nxnx_http_response_parse.nxnx_https_redirect.nxnx_http_range_req.nxnx_tls12_req.nxnx_tls12_client_session.nxnx_csprng.nxnx_gzip_wrap.nx

imported by: nx_4chan.nxnx_access_research_fetch.nxnx_adnet_research_fetch.nxnx_agentcap_sota_fetch.nxnx_aimode_lib.nxnx_apertus_mirror_nas.nxnx_apertus_shards_pull.nxnx_apertus_smallfiles.nxnx_apertus_tree_fetch.nxnx_api_sota_fetch.nxnx_apimcp_research_fetch.nxnx_archive_capture_demo.nxnx_archive_live.nxnx_archive_media_fetch.nxnx_archive_site_viewer.nxnx_archive_viewer.nxnx_archive_xcapture_fetch.nxnx_arcmine.nxnx_asr_research_fetch.nxnx_award_ui_research_fetch.nxnx_barcheck.nxnx_battery_research_fetch.nxnx_bench_fetch.nxnx_brand_exceed_research_fetch.nxnx_brand_research_fetch.nxnx_bulk_index.nxnx_cadtwin_research.nxnx_cadtwin_research2.nxnx_cam_chaturbate_probe.nxnx_cc_datahost_probe.nxnx_cc_ingest.nxnx_cc_record_fetch.nxnx_cc_warc_fetch.nxnx_cdnaccess_research_fetch.nxnx_cf_access_probe.nxnx_claim_verify.nxnx_clean_serve_daemon.nxnx_cleanview.nxnx_cleanwatch_serve.nxnx_codec_research_fetch.nxnx_commoncrawl_probe.nxnx_commoncrawl_query.nxnx_compare_instrument_verify.nxnx_compare_registry_assemble.nxnx_connect_research_fetch.nxnx_corpus_fetch.nxnx_crawl_callee_probe.nxnx_crawl_web.nxnx_dev_api_live_check.nxnx_dist_verify.nxnx_dlperf_research_fetch.nxnx_dm_research_fetch.nxnx_dmn_research_fetch.nxnx_doc_research_fetch.nxnx_docpub_research_fetch.nxnx_doctor_research_fetch.nxnx_doh_probe.nxnx_domain_map.nxnx_download_research_fetch.nxnx_dr_research_fetch.nxnx_eco_research_fetch.nxnx_eda_tooling_research_fetch.nxnx_edgar_submissions.nxnx_edge_watchdog.nxnx_effbench_research_fetch.nxnx_elara_ref_fetch.nxnx_emit_sota_fetch.nxnx_entity_card.nxnx_ereader_sota_fetch.nxnx_erotica_research_fetch.nxnx_evidence_research_fetch.nxnx_fabric_research_fetch.nxnx_feedfetch.nxnx_fetch.nxnx_fetch_any.nxnx_fetch_to_file.nxnx_fetchprobea.nxnx_fetchprobeb.nxnx_fetchprobec.nxnx_fetchprobed.nxnx_fetchprobew.nxnx_fin_edgar_fetch.nxnx_fin_fund_research_fetch.nxnx_fin_marketdata_fetch.nxnx_fin_md_probe.nxnx_fin_research_fetch.nxnx_font_gen_research_fetch.nxnx_font_legib_research_fetch.nxnx_font_research_fetch.nxnx_food_research_fetch.nxnx_foodsci2_research_fetch.nxnx_foodsci3_research_fetch.nxnx_foodsci_research_fetch.nxnx_forge_model_fetch.nxnx_game_asset_research_fetch.nxnx_game_ingest.nxnx_game_research_fetch.nxnx_gamechar_sota_fetch.nxnx_games_url_check.nxnx_ge_research_fetch.nx +141 more (shown cap 100 declared)

structs

none

consts

44const NX_FF_GZ_MAX_OUT: i64 = 33554432 // declared: 32MB inflate ceiling, so a zip-bomb cannot take the host
63const NX_MAGIC_4096: i64 = 4096
64const NX_MAGIC_2048: i64 = 2048
65const NX_MAGIC_65536: i64 = 65536
66const NX_MAGIC_20000: i64 = 20000
67const NX_MAGIC_8192: i64 = 8192
69const NX_FF_BAD_URL: i64 = 1
70const NX_FF_CONNECT: i64 = 2
71const NX_FF_HANDSHAKE: i64 = 3
72const NX_FF_GET: i64 = 4
73const NX_FF_PARSE: i64 = 5
74const NX_FF_NO_LOCATION: i64 = 6
75const NX_FF_TOO_MANY: i64 = 7
78const NX_FF_TRUNCATED: i64 = 9
85const NX_FF_FETCH_TIMEOUT_SECS: i64 = 8
169const NX_FF_JAR_BYTES: i64 = 3072
632const FF_LEG_PLAIN: i64 = 0 // ff_core mode 0, the plain 1.3 hello
633const FF_LEG_CHROME: i64 = 1 // ff_core mode 1, the Chrome-JA3 hello -- the last 1.3 arm
634const FF_LEG_NEXT: i64 = 0 // no HTTP answer parsed (n <= 0 or status <= 0), or a non-2xx from the plain hello: next leg
635const FF_LEG_DONE: i64 = 1 // a complete HTTP answer this leg is allowed to settle: the ladder is finished
636const FF_LEG_KEEP: i64 = 2 // an answer whose body fell short of its declared length: bank it, try the next leg

functions

45func ff_gunzip(out: *u8, n: i64, out_cap: i64) -> i64
called by 1: am_hop calls 1: nx_gzip_inflate
89func ff_path(urlbuf: *u8, target: *NxHttpsTarget, path_out: *u8) -> i64
114func ff_apps(dst: *u8, k0: i64, src: *u8) -> i64 { // append NUL-term src
called by 1: ff_resolve_location
119func ff_appn(dst: *u8, k0: i64, src: *u8, n: i64) -> i64 { // append n bytes
124func ff_appi(dst: *u8, k0: i64, v: i64) -> i64 { // append decimal int
calls 1: sys_mmap
133func ff_starts(s: *u8, p: *u8) -> i64 { // s starts with prefix p?
called by 1: ff_resolve_location
141func ff_resolve_location(loc: *u8, cur_urlbuf: *u8, cur: *NxHttpsTarget, outp: *u8) -> i64
172func ff_hdr_match(buf: *u8, pos: i64, n: i64, pat: *u8, patlen: i64) -> i64
186func ff_jar_set(jar: *u8, jl: *i64, cap: i64, name: *u8, name_len: i64, val: *u8, val_len: i64) -> i64
222func ff_collect_cookies(buf: *u8, n: i64, jar: *u8, jl: *i64, cap: i64) -> i64
248func ff_is_gate_url(url: *u8) -> i64
273func nx_https_last_hops() -> i64 { return ff_last_hops_g }
274func ff_core_x(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
401func ff_core(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
410func nx_https_fetch_follow_13only(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
416func nx_https_fetch_follow_chrome(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
425func nx_https_fetch_range(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
437func nx_https_fetch_head(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
441func _ff_range_core(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64, prefix_ok: i64,
517func ff_t12_diag(rc: i64) -> i64
550func nx_https_fetch_follow_12(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64, out_status: *i64) -> i64
637func ff_leg_verdict(leg: i64, n: i64, status: i64, body_state: i64) -> i64
644func nx_https_fetch_follow_best(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
691func nx_https_fetch_follow(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,
716func ff_keep(out: *u8, n: i64) -> *u8
723func ff_restore(keep: *u8, out: *u8, n: i64) -> i64
728func nx_https_fetch_follow_hdr_best(url0: *u8, store: *TrustStore, out: *u8, out_cap: i64,