This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// relay.js - WebSocket relay server for text-to-speech functionality | |
import { WebSocketServer, WebSocket as NodeWebSocket } from 'ws'; | |
import { v4 as uuidv4 } from 'uuid'; | |
/** | |
* RealtimeRelay - Manages WebSocket connections between a frontend client and Langflow backend | |
* Primarily handles text-to-speech (TTS) functionality with message queueing and audio response handling | |
*/ | |
export class RealtimeRelay { | |
constructor({ |