code wiki / (root) / nx_https_url_for_fetch.nx

nx_https_url_for_fetch.nx

buildroot/runtime/nx_https_url_for_fetch.nx

4784 B122 linesdepth 4pulls 5 transitivereach 497 importersview sourcekind tooltopic https
docsdependenciesstructsconstsfunctions

about

nx_https_url_for_fetch.nx -- step 1 of the HTTPS fetch orchestrator: parse + validate an HTTPS URL. Phase 0b §I.5 piece 1 of the nx_https_client wiring arc. Takes a NUL-terminated URL string, calls the shipped nx_url_parse to get its components, validates that scheme == "https", and defaults port to 443 when unspecified. Returns a populated NxHttpsTarget that the rest of the fetch pipeline consumes. This is a deliberately tiny primitive -- the next-step orchestrator (queued: nx_https_url_connect.nx, which does URL+DNS+TCP into a connected socket) composes this on top. Per Cardinal 22 (composition over configuration): small primitives stack into a working HTTPS fetcher. Public API: struct NxHttpsTarget { url: *NxUrl, -- shipped from nx_url port: i64, -- resolved (default 443) } nx_https_url_for_fetch(url_str, out_target) -> verdict nx_https_url_verdict_is_valid(v) -> 0|1 Sealed verdict enum: NX_HTTPS_URL_OK parse + scheme + port all good NX_HTTPS_URL_BAD_PARSE nx_url_parse returned negative NX_HTTPS_URL_WRONG_SCHEME scheme != "https" NX_HTTPS_URL_BAD_PORT port out of valid range Currently rejects http:// -- this primitive is HTTPS-only. An "http or https" variant for non-secure fetches is queued separately (nx_http_url_for_fetch.nx). Per Cardinals 9 (single-responsibility -- step 1 only; DNS / TCP / TLS are separate steps), 12 (defensive at boundaries -- scheme + port range checks), 23 (preamble names the queued variants). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_3986 lineage_id: nishi_https_url_for_fetch_q10

dependencies 2 imports · 80 importers

nx_syscalls.nx nx_url.nx nx_https_url_for_fetch.nx _dlr_probe.nx _h2_fetch_google.nx _h2_fetch_rumble.nx _h2_probe_imgsearch.nx _h2_probe_imgsearch_ua.nx _h2_reach_probe.nx nx_acme_directory_live.nx nx_acme_directory_live_real_ca_tes nx_acme_http.nx nx_app_monitor.nx

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

imports: nx_syscalls.nxnx_url.nx

imported by: _dlr_probe.nx_h2_fetch_google.nx_h2_fetch_rumble.nx_h2_probe_imgsearch.nx_h2_probe_imgsearch_ua.nx_h2_reach_probe.nxnx_acme_directory_live.nxnx_acme_directory_live_real_ca_test.nxnx_acme_http.nxnx_app_monitor.nxnx_aw_verify_gate.nxnx_browser_own_site_live_test.nxnx_cad_verify_gate.nxnx_chrome_fetch_probe.nxnx_connect_live_verify.nxnx_crew_live_verify.nxnx_dev_api_build_probe.nxnx_fetch_jellyfin_test.nxnx_funcheck.nxnx_gallery_auth_research_fetch.nxnx_hf_probe.nxnx_hifigan_stream_fetch.nxnx_hls_live_probe.nxnx_https_fetch.nxnx_https_fetch_file.nxnx_https_fetch_follow.nxnx_https_fetch_lib.nxnx_https_get.nxnx_https_get_cli.nxnx_https_get_cli2.nxnx_https_get_live_demo_test.nxnx_https_get_live_google_test.nxnx_https_get_live_real_ca_test.nxnx_https_ka_probe.nxnx_https_url_connect.nxnx_https_url_for_fetch_test.nxnx_hub_lib_verify_gate.nxnx_hub_verify_gate.nxnx_iot_fetch_probe.nxnx_iot_verify_gate.nxnx_lib_fetch.nxnx_lib_fetch_cookie.nxnx_library_fetch.nxnx_login_e2e_probe.nxnx_mcp_call.nxnx_mgmt_client.nxnx_model_fetch.nxnx_night_fetch_test.nxnx_nist_verify_gate.nxnx_office_live_verify.nxnx_onsite_frontier_fetch.nxnx_onsite_research_fetch.nxnx_orch_verify_gate.nxnx_porkbun_ping_probe.nxnx_research_fetch_wiki_test.nxnx_research_ka.nxnx_scilib_verify_gate.nxnx_sclass_ux_research_fetch.nxnx_semantic_research_fetch.nxnx_site_probe.nxnx_sovgit_push.nxnx_survey_live_verify.nxnx_tls12_client.nxnx_tls12_handshake_gate.nxnx_tls12_mutant.nxnx_tls12_probe.nxnx_tls12_probe_test.nxnx_tls12_req.nxnx_tls13_ch_compat_test.nxnx_tls13_recv_hs_diff_test.nxnx_tls13_recv_hs_probe_test.nxnx_url_probe.nxnx_url_truth_gate.nxnx_uxf_fetch_avro.nxnx_uxf_fetch_protobuf.nxnx_web_crawl_breadth.nxnx_web_crawl_index.nxnx_webpub_fetch.nxnx_ws_client_session.nxnx_zerodt_fetch.nx

structs

60struct NxHttpsTarget

consts

50const NX_MAGIC_65535: i64 = 65535
52const NX_HTTPS_URL_OK: i64 = 1
53const NX_HTTPS_URL_BAD_PARSE: i64 = 2
54const NX_HTTPS_URL_WRONG_SCHEME: i64 = 3
55const NX_HTTPS_URL_BAD_PORT: i64 = 4
56const NX_HTTPS_URL_VERDICT_N: i64 = 5
58const NX_HTTPS_DEFAULT_PORT: i64 = 443

functions

65func nx_https_url_verdict_is_valid(v: i64) -> i64
called by 1: main
74func _scheme_is_https(url_str: *u8, scheme_off: i64, scheme_len: i64) -> i64
98func nx_https_url_for_fetch(url_str: *u8, out_target: *NxHttpsTarget) -> i64
120func main() -> i64