(path: string)
| 994 | } |
| 995 | |
| 996 | const 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 | |
| 1008 | const maskedFrame = (opcode: number, payload: Buffer.Buffer): Buffer.Buffer => { |
| 1009 | const mask = randomBytes(4) |
no test coverage detected