# websocket.zig the first-party websocket library is a fork of [karlseguin/websocket.zig](https://github.com/karlseguin/websocket.zig), canonical at [tangled.org/zzstoatzz.io/websocket.zig](https://tangled.org/zzstoatzz.io/websocket.zig), maintained to track zig 0.16 — chiefly threading `std.Io` through the server. the fork and upstream are **not drop-in compatible**: the server entry point disagrees on argument order (fork: `WorkerState.init(allocator, io, config)`; upstream: `(io, allocator, config)`). a consumer's `http.zig` fork is paired to one lineage — mixing lineages in one dependency graph fails to compile. the reasoning behind allocator-before-io (and how to re-check it against std) is in [../io/patterns.md](../io/patterns.md#argument-ordering-where-does-io-go-relative-to-allocator); the one-version-per-package-graph rule that makes lineage mixing a build error is in [../build/dependencies.md](../build/dependencies.md#one-version-per-package-per-graph). when consuming: thread the `Io` from your event loop into `WorkerState`; don't construct a fresh one per worker. ## sources - canonical: [tangled.org/zzstoatzz.io/websocket.zig](https://tangled.org/zzstoatzz.io/websocket.zig) (v0.1.8, 2026) - upstream: [karlseguin/websocket.zig](https://github.com/karlseguin/websocket.zig)