(request: http.IncomingMessage, options: Required<Pick<RuntimeNodeHttpServerOptions, "allowUnauthenticatedLoopback">> & Pick<RuntimeNodeHttpServerOptions, "host" | "token">)
| 60 | } |
| 61 | |
| 62 | function isAuthorized(request: http.IncomingMessage, options: Required<Pick<RuntimeNodeHttpServerOptions, "allowUnauthenticatedLoopback">> & Pick<RuntimeNodeHttpServerOptions, "host" | "token">): boolean { |
| 63 | const token = tokenFromRequest(request) |
| 64 | if (options.token) return token === options.token |
| 65 | return options.allowUnauthenticatedLoopback && isLoopbackHost(options.host ?? "127.0.0.1") |
| 66 | } |
| 67 | |
| 68 | function attachSocket(runtime: RuntimeServer, socket: WebSocket, request: http.IncomingMessage, options: RuntimeNodeHttpServerOptions): void { |
| 69 | const connectionId = `node:${randomUUID()}` |
no test coverage detected