ironie-nextjs/src/app/lib/websocket-server-client.ts
2025-06-09 13:21:06 +02:00

15 lines
447 B
TypeScript

const host = 'localhost' // oder deine IP wie '10.0.1.25'
export async function sendServerWebSocketMessage(message: any) {
try {
console.log('[WebSocket Client] Message:', message)
await fetch(`http://${host}:3001/send`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(message)
})
} catch (error) {
console.error('[WebSocket Client] Fehler beim Senden:', error)
}
}