mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	@@ -194,20 +194,23 @@ module.exports = function(RED) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    WebSocketListenerNode.prototype.broadcast = function(data) {
 | 
					    WebSocketListenerNode.prototype.broadcast = function(data) {
 | 
				
			||||||
        try {
 | 
					        if (this.isServer) {
 | 
				
			||||||
            if (this.isServer) {
 | 
					            for (let client in this._clients) {
 | 
				
			||||||
                for (let client in this._clients) {
 | 
					                if (this._clients.hasOwnProperty(client)) {
 | 
				
			||||||
                    if (this._clients.hasOwnProperty(client)) {
 | 
					                    try {
 | 
				
			||||||
                        this._clients[client].send(data);
 | 
					                        this._clients[client].send(data);
 | 
				
			||||||
 | 
					                    } catch(err) {
 | 
				
			||||||
 | 
					                        this.warn(RED._("websocket.errors.send-error")+" "+client+" "+err.toString())
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					 | 
				
			||||||
                this.server.send(data);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        catch(e) { // swallow any errors
 | 
					        else {
 | 
				
			||||||
            this.warn("ws:"+i+" : "+e);
 | 
					            try {
 | 
				
			||||||
 | 
					                this.server.send(data);
 | 
				
			||||||
 | 
					            } catch(err) {
 | 
				
			||||||
 | 
					                this.warn(RED._("websocket.errors.send-error")+" "+err.toString())
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user