In nodejs how to connect to multiple endpoints based on the comma separated endpoint values. I am using the library https://www.npmjs.com/package/websocket. From a single client I am able to connect but I am not getting how to connect to multiple endpoints. Below is the code for single websocket connection.
const WebSocket = require('ws');
const ws = new WebSocket('wss://echo.websocket.org');
ws.on('open', function open() {
ws.send('something');
});
ws.on('message', function incoming(data) {
console.log(data);
});