nx_websocket_client_upgrade_test.nx
buildroot/runtime/nx_websocket_client_upgrade_test.nx
about
nx_websocket_client_upgrade_test.nx -- KAT for CLIENT-side WebSocket
HTTP/1.1 upgrade per RFC 6455 §1.3 + §4.1 + §4.2.
Covers:
T1: request-builder writes a syntactically correct GET upgrade
T2: validator accepts a canonical 101 response keyed by RFC's §1.3
worked example (key = "dGhlIHNhbXBsZSBub25jZQ==").
T3: validator rejects bad status line (200 instead of 101)
T4: validator rejects missing Upgrade header
T5: validator rejects missing Connection header
T6: validator rejects Sec-WebSocket-Accept that does not match
SHA-1+Base64 of the client key + RFC GUID (i.e., a forged
response or a real-but-mismatched-key bug).
T7: include_port_in_host=1 adds ":port" to Host header
Per Cardinal 13 (additive-only data: this test is the new gate
for this module + it composes the SAME SHA-1+Base64 ws_accept
primitive the server side uses to AVOID re-implementing the
reference algorithm).
expect_exit: 0
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_websocket_client_upgrade.nxnx_websocket_handshake.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 29 | func _t_find_sub(buf: *u8, n: i64, needle: *u8, nn: i64) -> i64 called by 1: main |
| 46 | func _t_build_canonical_101(out: *u8) -> i64 called by 1: main |
| 56 | func main() -> i64 |