Repository navigation
Releases
Releases · baskingspot/websocket
v0.3.0
Changed
- The package requires Zig 0.17. Zig 0.16 support is gone:
minimum_zig_version
is0.17.0, the devshell is the 0.17 shell, and the version probes in
build.zigare replaced byRun.addPassthruArgs. The public API and the
frame behavior are unchanged.
v0.2.0
Changed
- The package builds on Zig 0.16 and 0.17 from one tree, and a consumer on
either version can fetch it. The build script andMask.applyuse the forms
both versions have: array multiplication is gone from the hot loop, and
b.args,LazyPath.getPath, andb.getInstallPathare replaced. The
zig-nextdevshell now runs the same tests through testingx as the default
shell. - The
baskingspot/httppin moves from v0.1.0 to v0.4.2, the first release
that builds on both Zig versions.examples/http-echo.zigcompiles against
it unchanged.
Removed
examples/xev-echo.zigand thelibxevdependency behind it. Zig resolves
every dependency named in a manifest once anylazyDependencycall is made,
so a lazy dependency with no Zig 0.17 build stops a Zig 0.17 consumer before
the root build script runs. A lazy dependency is still a dependency.
examples/holds four programs, and the frame layer never needed an event
loop.
v0.1.0
Added
serverandclientnamespaces. Each re-exports the parser, the writer, and
the close types for its role, so a program imports one and gets the frame
rules that belong to it: a server unmasks what it reads and writes unmasked,
a client does the reverse.Parser, the streaming frame parser.feedtakes the bytes read from the
socket and returns.frame_header,.payload,.frame_end, or
.need_more, with the count it consumed. It reads payload bytes in place,
unmasks them in the buffer it was given, and holds no allocation.FrameHandler, the message layer overParser. It reassembles fragments
and returns.data,.data_end,.ping,.pong,.close, or
.need_more, with the 125-byte control payload kept in the handler itself.MessageValidator, the RFC 6455 Section 5.4 fragmentation check as a
separate value, for a caller that drivesParserand wants
error.UnexpectedContinuationanderror.ExpectedContinuationinstead of
tracking the state by hand.writeFrame,writeClose,writePing, andwritePong.client.writeFrame
takes a mutable payload because RFC 6455 Section 5.3 makes it XOR the mask
into the buffer before writing.MessageWriter, which streams one message across frames withwriteChunk
andfinish, asserver.MessageWriterandclient.MessageWriter.FrameHeader.Buffer, the serialized header on its own for scatter-gather
writes.Mask,MaskKey, andclient.generateMaskKey: the four-byte key,
Mask.applyfor masking or unmasking a chunk, and a key from
std.crypto.random.CloseCode,ClosePayload, andparseClosePayload: the RFC 6455 Section
7.4 codes, plus a parser that rejects a one-byte payload and a code the
wire forbids.ExtensionandExtension.DeflateConfig: thepermessage-deflate
negotiation (RFC 7692), the RSV1 bit, and thecompressedflag on a written
frame. Deflate itself is the caller's library.computeAcceptKey,UpgradeRequest,validateUpgradeRequest, and
UpgradeResponse: theSec-WebSocket-Acceptvalue, the two WebSocket
fields an upgrade request carries, their validation, and a complete 101
response in a fixed buffer.- The Autobahn TestSuite passes 247 of 247 cases in its fast profile against
the echo server, and that profile is a CI gate.