Networking
js/net.md
Fino networking ranges from high-level Fetch-style HTTP to low-level sockets, TLS, DNS, mDNS, QUIC, WebSockets, server-sent events, and WebTransport.
Start with the highest-level API that matches the protocol. For anything HTTP-shaped — servers, routing, clients, WebSockets, SSE, WebTransport — start with the HTTP section:
- Use
fino:net/http/serverfor HTTP servers andfino:net/http/appfor routing and middleware. - Use
fino:net/http/clientor globalfetch()for HTTP clients. - Use
fino:net/http/websocketfor WebSockets. - Use
fino:net/http/webtransportfor WebTransport. - Use
fino:net/socket,fino:net/tls,fino:net/dns,fino:net/mdns, andfino:net/quicwhen building lower-level protocol tools.
Low-Level Sockets
Socket APIs expose nonblocking descriptors, async readers/writers, datagrams, address helpers, and errno constants. They are useful for custom protocols and runtime modules, but application servers should prefer HTTP, WebSocket, or WebTransport helpers.
TLS And QUIC
fino:net/tls wraps OpenSSL for client and server handshakes. fino:net/quic
provides QUIC endpoint and stream primitives used by HTTP/3 and WebTransport.
Availability depends on linked native libraries; check capability booleans and
handle unavailable protocol support explicitly.
DNS
fino:net/dns resolves names through provider abstractions, and fino:net/mdns
handles local multicast discovery. Use provider injection in tests when network
answers must be deterministic.