WSS prox konfiguration
This commit is contained in:
@@ -21,11 +21,15 @@ function setupCommandForwarding(wssInput, targetUrl) {
|
||||
|
||||
targetSocket.on("message", (msg) => {
|
||||
const data = msg.toString();
|
||||
console.log("⬅️ Message from Driver to Sim:", data);
|
||||
console.log("⬅️ Message from Driver to Sim:", data, "→ clients:", clients.size);
|
||||
// Broadcast to all connected browsers
|
||||
for (const client of clients) {
|
||||
if (client.readyState === WebSocket.OPEN) {
|
||||
client.send(data);
|
||||
try {
|
||||
client.send(data);
|
||||
} catch (err) {
|
||||
console.error("❌ Error sending to client:", err.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user