On this page:

2.1 WebSocket Connections

(ws-socket? v)  any
  v : any/c
Checks whether the given value v is a WebSocket.

(ws-socket-url socket)  ws-url?
  socket : ws-socket?
Extracts the URL designating the server side end point from a WebSocket.

(ws-socket-protocol socket)  (or/c string? #f)
  socket : ws-socket?
Determines the negotiated protocol for a WebSocket, if any. See ws-connect and ws-listen for details about how the protocol is established.

(ws-connect url [protocol ssl-context])  ws-socket?
  url : ws-url?
  protocol : (or/c string? #f) = #f
  ssl-context : (or/c ssl-client-context? symbol?) = 'tls
Connects to a WebSocket server specified by url. Uses a TCP or TLS connection as required by the scheme of the WebSocket URL.

If protocol is a string, the connection only succeeds if the WebSocket server replies with a matching protocol header to indicate that it supports this protocol.

The ssl-context argument is ignored for connection with the URL scheme "ws". For secure WebSocket connections with the URL scheme "wss", it can be used to control the setup of the SSL engine. It defaults to a TLS connection without any special setup.