Skip to content

Networking

codingncaffeine edited this page Sep 6, 2026 · 14 revisions

Networking

Every layer between a typed address and a page's bytes is written in the repository, behind one fetch() choke point that tools/egress-check.sh enforces in CI.

URLs

The WHATWG URL parser, at 893 / 893 (100%) on the Web Platform Tests' urltestdata: the state machine, every encode set, full IPv4 and IPv6, domain-to-ASCII through UTS #46 and NFC over generated Unicode tables, and Punycode in both directions.

HTTP/1.1

  • Requests through one client: chunked transfer, Content-Length, read-to-close; content decoding with a full inflate (stored, fixed and dynamic Huffman; zlib and gzip framing; bomb-capped); redirects; body caps.
  • Persistent connections. A connection whose response was delimited and not marked close goes back to the session pool under its scheme, host and port, and the next request to that origin skips the connect and the TLS handshake — 32 idle, 6 per origin, 60 seconds. Interim 1xx responses (103 Early Hints included) are stepped past; 204 and 304 read no body; a pooled connection found dead is retried once on a fresh one.
  • Wikipedia's article page with its 14 stylesheets and pictures loads in about a second on 3 connections opened and 14 reused.
  • A page's own requests. fetch() and XMLHttpRequest (Scripting) go through the same choke point with the page's session: the method, headers and body as the script set them (the exchange keeps Host, Content-Length, Connection, Accept-Encoding and Cookie its own), cookies only where the request allows them and never across sites, a 303 — or a 301 or 302 on a POST — turned into a GET with the body and its headers dropped, 307 and 308 kept as they were, a HEAD reading no body, and only a GET consulting or feeding the cache. The browser's CORS rules are applied above the choke point, in the bindings.

TLS

  • Windows: SChannel, with real certificate validation and revocation checking below the root (soft-fail when the revocation server is unreachable). The badssl.com matrix — expired, self-signed, wrong host, untrusted root, revoked — is refused, and a certificate that fails lands on a page with no way through.
  • Linux: a TLS 1.3 client of Sashfold's own (Linux has no OS TLS to lean on): one suite, ChaCha20-Poly1305, one group, x25519; certificates validated against the system CA bundle with signatures, validity, name constraints and hostname matching, and the bad badssl rows refused. CRL fetching, AES-GCM and HelloRetryRequest are not written yet, so it is not through the badssl gate; SASHFOLD_TLS_INSECURE=1 accepts any certificate and says so loudly.
  • macOS: not written yet (Network.framework).

Cookies

An RFC 6265 cookie jar with third-party cookies blocked by default: a request a page makes to another site carries none of that site's cookies and stores none. The date parser doubles as the HTTP date parser.

The cache

A session cache that honors only explicit freshness: max-age, Expires and Age; no-store and no-cache skip it; Vary is honored for Accept, Accept-Encoding and User-Agent and refuses anything else; Set-Cookie is never replayed from a hit. Lookup happens per hop of a redirect chain; 8 MB per entry, 64 MB in all.

Other schemes

data: URLs (with a forgiving base64), about:blank, about:sashfold, view-source:, reader:, and file: for local pages (a file: page may load file: subresources; a web page may not).

Downloads

A response the engine cannot render — a type it does not show, or a Content-Disposition: attachment — is saved under a fresh, sanitized name in the Downloads folder, marked with the mark of the web (the NTFS Zone.Identifier stream carrying the source and referrer URLs), and never opened.

Policies

  • HTTPS-first: a typed host is tried over https; http is tried once, only when the connection itself fails, never after a certificate error.
  • Referrer: strict-origin-when-cross-origin — a cross-site request tells the other site the origin, never the full URL.

The user agent string

Sashfold sends Mozilla/5.0 (<platform>) Sashfold/<version> — for example Mozilla/5.0 (Windows NT 10.0; Win64; x64) Sashfold/0.0.5. The Mozilla/5.0 prefix and the platform token are the compatibility-shaped form every engine ships, because servers still key on them; the honest part is the Sashfold/<version> suffix, the only thing that identifies the browser, and the version is the release's own. The string carries no build number, locale or hardware detail, and it is the same for every user of a given platform.

Clone this wiki locally