MCPcopy Create free account
hub / github.com/Effect-TS/effect / upgradeRequest

Function upgradeRequest

packages/platform-node/test/HttpServer.test.ts:996–1006  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

994}
995
996const upgradeRequest = (path: string): string =>
997 [
998 `GET ${path} HTTP/1.1`,
999 "Host: 127.0.0.1",
1000 "Upgrade: websocket",
1001 "Connection: Upgrade",
1002 `Sec-WebSocket-Key: ${randomBytes(16).toString("base64")}`,
1003 "Sec-WebSocket-Version: 13",
1004 "",
1005 ""
1006 ].join("\r\n")
1007
1008const maskedFrame = (opcode: number, payload: Buffer.Buffer): Buffer.Buffer => {
1009 const mask = randomBytes(4)

Callers 2

rawWebSocketFunction · 0.85
rawUpgradeRequestFunction · 0.85

Calls 2

joinMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected