MCPcopy
hub / github.com/cloudflare/cloudflared / NewResponseHeader

Function NewResponseHeader

websocket/websocket.go:17–23  ·  view source on GitHub ↗

NewResponseHeader returns headers needed to return to origin for completing handshake

(req *http.Request)

Source from the content-addressed store, hash-verified

15
16// NewResponseHeader returns headers needed to return to origin for completing handshake
17func NewResponseHeader(req *http.Request) http.Header {
18 header := http.Header{}
19 header.Add("Connection", "Upgrade")
20 header.Add("Sec-Websocket-Accept", generateAcceptKey(req.Header.Get("Sec-WebSocket-Key")))
21 header.Add("Upgrade", "websocket")
22 return header
23}
24
25// from RFC-6455
26var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")

Callers 2

AckConnectionMethod · 0.92

Calls 3

generateAcceptKeyFunction · 0.85
GetMethod · 0.80
AddMethod · 0.65

Tested by 1