Something went wrong. Try again.
The WebSocket Protocol (RFC 6455) for Zig: framing, a client, and a server handshake on zig-http
Something went wrong. Try again.
123456789101112131415161718192021222324252627// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! The server half of the opening handshake, which is the only part of this//! library that needs an HTTP implementation.//!//! It is a module of its own for that reason. A server has a request in hand//! and an HTTP version to worry about, so `accept` is written against//! zig-http; a client has neither and should not have to depend on an HTTP//! server library to open a connection. Everything else -- the framing, the//! connection, the client handshake -- is in `websocket`, which depends on//! nothing but the standard library.
const std = @import("std");
pub const handshake = @import("handshake.zig");
/// RFC 6455 §4.2 over HTTP/1.1, RFC 8441 §5 over HTTP/2. See/// `handshake.accept`.pub const accept = handshake.accept;/// Answers a handshake `accept` refused, the way the RFC suggests.pub const refuse = handshake.refuse;
test { std.testing.refAllDecls(@This());}