Import with #import "std/net_ws_curl_linux".

PollDescriptor :: struct { fd: s32; events: s16; returned: s16; }
PollRead :: 1
NoSocket :: () -> PollDescriptor
ValidSocket :: (descriptor: PollDescriptor) -> bool
CurlWsFrame :: struct { age: s32; flags: s32; offset: s64; bytes_left: s64; length: u64; }
CurlConnectOnly :: 141
CurlActiveSocket :: 5242924
CurlAgain :: 81
CurlWsText :: 1
CurlWsContinue :: 4
CurlWsClose :: 8

Output is NUL terminated on success. status is 401 on an unauthorized

ReceiveWebSocketCurl :: (context: *void, url: string, token: string, output: []u8, status: *s32) -> bool

Output is NUL terminated on success. status is 401 on an unauthorized handshake so a protocol client can refresh its session and retry.

Source ↗ · All modules