code wiki / (root) / nx_http_client.nx

nx_http_client.nx

buildroot/runtime/nx_http_client.nx

16741 B400 linesdepth 5pulls 7 transitivereach 545 importersview sourcekind librarytopic http
docsdependenciesstructsconstsfunctions

about

nx_http_client.nx -- sovereign HTTP/1.1 GET client. Phase 0 of the Nishi browser per docs/NISHI_BROWSER_ROADMAP.md. Smallest possible NX-side HTTP client: TCP connect + send GET + receive response. No libc. No curl. No fetch shim. What it does today: - opens a TCP socket - connects to a caller-provided IPv4 address + port - sends "GET <path> HTTP/1.1\r\nHost: <host>\r\nConnection: close\r\n\r\n" - reads the response until the server closes - hands the caller the raw bytes (header + body) What it doesn't do yet: - DNS lookup (caller passes a packed IPv4 + port). L20b queued. - HTTP/1.1 keep-alive (we Connection: close to make the read-to-EOF pattern correct). - HTTP/2, HTTP/3, ALPN. Eventually. - TLS. Phase 8. - Redirects (302). Caller handles. genealogy_id: rfc_7230_http_1_1 + linux_socket_api + nishi_pages_v1_pages_nx lineage_id: nishi_browser_http_client_q10

dependencies 4 imports · 45 importers

nx_syscalls.nx nx_connect.nx nx_dec_emit.nx nx_codec_caps.nx nx_http_client.nx nx_acme_http.nx nx_aw_smoke.nx nx_browser_image_demo_test.nx nx_browser_page_demo_test.nx nx_cms_admin_gate.nx nx_cms_webdev_gate.nx nx_crawl_bfs.nx nx_crawl_main.nx nx_crawl_polite.nx nx_crawl_run.nx

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

imports: nx_syscalls.nxnx_connect.nxnx_dec_emit.nxnx_codec_caps.nx

imported by: nx_acme_http.nxnx_aw_smoke.nxnx_browser_image_demo_test.nxnx_browser_page_demo_test.nxnx_cms_admin_gate.nxnx_cms_webdev_gate.nxnx_crawl_bfs.nxnx_crawl_main.nxnx_crawl_polite.nxnx_crawl_run.nxnx_embed_live_gate.nxnx_f32_llm_serve.nxnx_forge_model.nxnx_http_client_post_test.nxnx_http_fetch.nxnx_http_loopback_gate.nxnx_http_post.nxnx_http_post_gate.nxnx_http_probe.nxnx_http_tracker.nxnx_https_client.nxnx_https_get_complete.nxnx_https_get_spoof.nxnx_https_get_stream.nxnx_https_post_complete.nxnx_live_crawl.nxnx_llm_batch_serve.nxnx_media_e2e_gate.nxnx_mesh_autoscale.nxnx_mesh_gen.nxnx_mesh_hostagent.nxnx_mesh_lb.nxnx_mesh_probe.nxnx_office_serve.nxnx_search_crawl_server.nxnx_studio_e2e_gate.nxnx_torrent_daemon_gate.nxnx_torrent_gw.nxnx_torrent_stream_live_gate.nxnx_video_get.nxnx_vroom_loadtest.nxnx_wiki_projects.nxnx_writehub_grow.nxnx_writehub_seat.nxnx_writer_probe.nx

structs

none

consts

35const NX_MAGIC_1024: i64 = 1024
64const NX_MAGIC_4096: i64 = 4096
67const NX_HTTP_C_VERDICT_UNKNOWN: i64 = 0
68const NX_HTTP_C_VERDICT_OK: i64 = 1
69const NX_HTTP_C_VERDICT_SOCKET_FAIL: i64 = 2
70const NX_HTTP_C_VERDICT_CONNECT_FAIL: i64 = 3
71const NX_HTTP_C_VERDICT_SEND_FAIL: i64 = 4
72const NX_HTTP_C_VERDICT_RECV_FAIL: i64 = 5
73const NX_HTTP_C_VERDICT_N: i64 = 6
88const NX_HTTP_C_CONNECT_MS: i64 = 6000

functions

52func hc_put_caps(out: *u8, o: i64) -> i64
90func nx_http_client_build_request(
146func nx_http_client_build_request_xhdr(
called by 1: nx_https_fetch_hdr calls 1: hc_put_caps
251func nx_http_client_build_request_post(
320func nx_http_client_sockaddr_ipv4(
340func _drain(fd: i64, buf: *u8, cap: i64) -> i64
357func nx_http_client_get(
396func nx_http_c_verdict_is_valid(v: i64) -> i64