Spaces:
Runtime error
Runtime error
Download api/src/plugins/browser-socket/handlers/cast.handler.ts from supernovagateway/Steel: direct link, hf CLI and curl.
- Browser
- Download file 651 Bytes
-
https://huggingface.co/spaces/supernovagateway/Steel/resolve/main/api/src/plugins/browser-socket/handlers/cast.handler.ts
- Command line
-
hf download hf://spaces/supernovagateway/Steel/api/src/plugins/browser-socket/handlers/cast.handler.ts
-
curl -L -o cast.handler.ts https://huggingface.co/spaces/supernovagateway/Steel/resolve/main/api/src/plugins/browser-socket/handlers/cast.handler.ts
651 Bytes
| import { IncomingMessage } from "http"; | |
| import { Duplex } from "stream"; | |
| import { WebSocketHandler, WebSocketHandlerContext } from "../../../types/websocket.js"; | |
| import { handleCastSession } from "../casting.handler.js"; | |
| export const castHandler: WebSocketHandler = { | |
| path: "/v1/sessions/cast", | |
| handler: async ( | |
| request: IncomingMessage, | |
| socket: Duplex, | |
| head: Buffer, | |
| context: WebSocketHandlerContext, | |
| ) => { | |
| context.fastify.log.info("Connecting to cast..."); | |
| await handleCastSession( | |
| request, | |
| socket, | |
| head, | |
| context.wss, | |
| context.fastify.sessionService, | |
| context.params, | |
| ); | |
| }, | |
| }; | |