(path: string)
| 2737 | } |
| 2738 | |
| 2739 | const 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 | |
| 2751 | const closeFrame = (code: number): Buffer.Buffer => { |
| 2752 | const payload = Buffer.Buffer.alloc(2) |
no test coverage detected