add-websocket-upgrade-headers ( request -- request )


Vocabulary
http.websockets

Inputs
requestan object


Outputs
requestan object


Definition


: add-websocket-upgrade-headers ( request -- request )
"connection" over header>> delete-at
websocket-version "Sec-WebSocket-Version" set-header
random-websocket-key "Sec-WebSocket-Key" set-header
"Upgrade" "Connection" set-header
"websocket" "Upgrade" set-header
"no-cache" "Pragma" set-header
"no-cache" "Cache-Control" set-header
"permessage-deflate; client_max_window_bits"
"Sec-WebSocket-Extensions" set-header
dup url>> host>> "Host" set-header dup url>>
[ "ws" = "http" "https" ? ] change-protocol drop ;