bend-kit-websocket
Releases (6)
Definitions (148)
websocket.bend
- def guid
- def accept.inputThe octets SHA-1 hashes for Sec-WebSocket-Accept: the key, then the GUID.
- def accept.ofSec-WebSocket-Accept from the SHA-1 digest of accept.input(key).
- def accept.fin
- def accept.words
- def acceptThe Sec-WebSocket-Accept a server must answer to key.
- def key.ofSec-WebSocket-Key from a 16-octet nonce.
- def key.fin
- def keyA fresh key from 16 octets of the OS secure random source.
- def first
- def reject
- def verdict
- def visibleEvery char is visible ASCII (0x21-0x7E): no space, CR, LF, or other control.
- def requestThe GET that asks to upgrade.
- def fields.line
- def fields.go
- def after.first
- def headersThe header lines of an HTTP head: every line after the start line.
- def fieldsThe trimmed values of every header line named name (lowercase), in order.
- def only
- def fieldThe value of the header named name when exactly one line has it.
- def line.partsA header line is name ":" value, with a non-empty name that holds no space or tab (RFC 9112 §5.1).
- def lines.ok
- def status.parts
- def statusThe first line is exactly "HTTP/1.1 101" and a reason, with nothing before it.
- def token
- def value.is
- def value.lower
- def tokensConnection is a list header: its lines join into one comma list (RFC 9110 §5.3).
- def none
- def checkDoes a server's head (up to its blank line) accept the upgrade?
- def with_slice
- type SplitAn HTTP head cut at its blank line, with the bytes after it.
- def split.long
- def split.short
- def split.found
- def splitFound once b holds "\r\n\r\n"; Long when 16 KiB came without it.
- type FrameThe payload P is Bytes at run time and a List of octets in the proofs.
- type DecodeNeed: the input does not hold a whole frame yet, and comes back intact.
- def mask.go
- def mask.trim.word
- def mask.trim.if
- def mask.trimBytes at or past len stay 0, as Bytes requires.
- def maskThe payload XOR the mask key (§5.3), a word at a time.
- def known
- def rules.bigThe §5.2 and §5.5 rules on a frame header.
- def rules
- def encode.ext
- def encode.mkey
- def encode.copy
- def encode.framePayload lengths use the shortest form (§5.2): 7 bits, then 16, then 64.
- def encode.key
- def encode.checked
- def encodeA frame's octets.
- type HeaderA frame header, read from a list of the first octets of the input.
- def header.verdict
- def header.errA 64-bit length with a high word is over any U32 max, and is a control frame over 125.
- def header.check
- def header.keyThe mask key (§5.3) follows the length; its first octet is the key's low byte.
- def be32
- def header.ext16
- def header.ext64
- def header.extshort: no extended length (l7 < 126); mid: 2 octets of it (l7 == 126); else 8.
- def header.b1
- def headerThe header at the front of p, from octets below 256.
- def unmask.whenThe decoder, over any input S with four operations, giving payloads P: prefix gives at least the first 14 octets as a list; fits tells if hs + len octets are in; cut splits into the payload [hs, hs + len) and the input from hs + len on; unmask XORs a mask key.
- def next.got
- def next.fits
- def next.sizeover: the payload is longer than max.
- def next.head
- def next.start
- def nextOne frame from the front of b, unmasked.
- def bytes.prefix.con
- def bytes.prefix.go
- def bytes.prefix.back
- def bytes.prefix
- def bytes.fitshs + len octets fit in end - pos exactly when this holds (Bytes law fits_exact); see law cut_exact.
- def bytes.cut.rest
- def bytes.cut
- def bytes.unmask
- def parseThe decoder over Bytes, as recv runs it.
- def push.when
- def pushThe input with a read after it.
- def list.prefix
- def list.fits
- def list.cut
- def list.unmask.goOctet i goes XOR key byte i mod 4; the key turns one byte per octet.
- def list.unmask
- def list.next
- def stUTF-8 (RFC 3629) validity.
- def utf8.lead
- def utf8.next
- def utf8.go
- def utf8.fin
- def utf8.validb back, and whether it is well-formed UTF-8.
- type Partial
- type Msg
- def done.text
- def finish
- def feed.more