code wiki / _hdl_build / nx_browser_view_serve.nx

nx_browser_view_serve.nx

buildroot/runtime/_hdl_build/nx_browser_view_serve.nx

2756 B59 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind servicetopic browser
docsdependenciesstructsconstsfunctions

about

nx_browser_view_serve.nx -- surface the nishi browser's render as a web page reachable from the WINDOWS browser via WSL2 localhost-forwarding (identical path to the :8097 media daemon, nx_torrent_daemon). Pure COMPOSITION, no new server machinery: the sovereign HTTP primitive (nx_http_server) + static file serving (nx_pages_static, sets image/png). Bind 0.0.0.0 -> accept -> read_request -> serve _offc/<file>. Route bare "/" -> the viewer page (nx_pages_serve_file 404s on "/" by design). Both imports pull only nx_syscalls.nx (no nx_syscalls_x86_64 dup), so the composite assembles.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_http.nx nx_http_server.nx nx_pages_static.nx nx_browser_view_serve.nx

imports: nx_syscalls.nxnx_http.nxnx_http_server.nxnx_pages_static.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nx_http_server_addr_any nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap ↻ sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen

structs

none

consts

12const BV_PORT: i64 = 8099
13const BV_BACKLOG: i64 = 64
14const BV_REQ_CAP: i64 = 16384
15const BV_RESP_CAP: i64 = 4194304 // 4 MB (a 1000x1000 PNG fits with room to spare)

functions

18func bv_serve_one(cfd: i64) -> i64
41func main() -> i64