Something went wrong. Try again.
An HTTP library for Zig 0.17, server and client, HTTP/1.0 through HTTP/3, with the protocol in a module that owns no socket.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! HTTP with the I/O put back: sockets, and the listeners that own them.//!//! `http` is the protocol and nothing else -- it parses, it frames, it//! decides what a response to a request is, and every byte reaches it through//! a `transport.Connection` or a `transport.Session` that it cannot see//! behind. That is what makes it testable over a slice of memory, fuzzable at//! half a million inputs a second, and portable to a transport nobody has//! written yet.//!//! It is also not a server. Something has to open a socket, accept what//! arrives on it and hand it over, and that is this module: the TCP listener,//! the QUIC-backed session that HTTP/3 runs on, and the HTTP/3 listener that//! owns a UDP socket. A caller wanting an ordinary server wants both modules;//! a caller embedding HTTP in something that already has its own I/O wants//! only the first.
const std = @import("std");
pub const tcp = @import("tcp.zig");/// HTTPS: the same listener with a TLS handshake on the front of it.pub const tls = @import("tls.zig");/// A `transport.Session` backed by a real QUIC connection.pub const session = @import("session.zig");/// An HTTP/3 server, which owns a UDP socket.pub const http3 = @import("http3.zig");/// HTTP proxies: forwarding a request through one, and `CONNECT` tunnels.pub const proxy = @import("proxy.zig");/// What origins have advertised with `Alt-Svc`: a cache of HTTP/3/// alternatives, lockable so that `Client`s on several tasks can share one.pub const AltSvc = @import("AltSvc.zig");/// A client that takes a URL, resolves the name, dials it and negotiates the/// version: `std.http.Client.fetch`'s shape over HTTP/1.1 and HTTP/2.pub const Client = @import("Client.zig");
test { std.testing.refAllDecls(@This());}