code wiki / (root) / nx_websocket_client_upgrade_test.nx

nx_websocket_client_upgrade_test.nx

buildroot/runtime/nx_websocket_client_upgrade_test.nx

6252 B144 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic websocket
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_websocket_client_upgrade.nx nx_websocket_handshake.nx nx_websocket_client_upgrade_te

imports: nx_syscalls.nxnx_websocket_client_upgrade.nxnx_websocket_handshake.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

29func _t_find_sub(buf: *u8, n: i64, needle: *u8, nn: i64) -> i64
46func _t_build_canonical_101(out: *u8) -> i64
56func main() -> i64