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

Function upgradeRequest

packages/platform/node/test/NodeHttpServer.test.ts:2739–2749  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

2737}
2738
2739const upgradeRequest = (path: string): string =>
2740 [
2741 `GET ${path} HTTP/1.1`,
2742 "Host: 127.0.0.1",
2743 "Upgrade: websocket",
2744 "Connection: Upgrade",
2745 `Sec-WebSocket-Key: ${randomBytes(16).toString("base64")}`,
2746 "Sec-WebSocket-Version: 13",
2747 "",
2748 ""
2749 ].join("\r\n")
2750
2751const closeFrame = (code: number): Buffer.Buffer => {
2752 const payload = Buffer.Buffer.alloc(2)

Callers 3

rawWebSocketFunction · 0.85
rawUpgradeRequestFunction · 0.85

Calls 3

randomBytesFunction · 0.85
toStringMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected