Closed navjotghotra closed 6 years ago
@navjotghotra Each client socket can only have a single host name. You can use a domain name as the host name and then use a DNS system to do some sort of round-robin IP selection behind the scenes... Or you can create multiple sockets; one for each host.
I am trying to connect to multiple hostnames with different ports. I know how to connect to one using socketcluster.connect(options) where options is an object like this -
How can I add more hostnames to the object? I tried creating an array and add more objects to it - var options = [{ hostname: '127.0.0.1', port: 8019, rejectUnauthorized: false, secure: false },{ hostname: 'abc', port: 8019, rejectUnauthorized: false, secure: true }] but that gives an error of -
WebSocket connection to 'ws://localhost:5000/socketcluster/' failed: Connection closed before receiving a handshake response