[I've flagged this question to be deleted by moderator until I get answer to my this question]
My javascript client is working fine when talking to node.js(on Ubuntu, more here) server through WebSocket interface with IPV4 IP address.
Even though my Hosting provider is ready to allocate me IPV4, let me instead use IPV6 since there is limited supply of IPV4 now.
When using the IPV6 IP I'm getting this error:
WebSocket connection to 'ws://[2600:3c00::f03c:91ff:fe73:2b08]:31333/' failed: Error in connection establishment: net::ERR_ADDRESS_UNREACHABLE
I've checked that port 31333 is indeed open using tool: http://www.subnetonline.com/pages/ipv6-network-tools/online-ipv6-port-scanner.php
I've even tried solution as in IPv6 address giveing syntax error in internet explorer-10 websocket -- that is : 2600-3c00-0-0-f03c-91ff-fe73-2b08.ipv6-literal.net
I've run this client and is able to connect to the server when both are running on remote Ubuntu based server:
var WebSocket = require('ws')
, ws = new WebSocket('ws://[2600:3c00::f03c:91ff:fe73:2b08]:31333');
ws.on('open', function() {
ws.send('something');
});
ws.on('message', function(message) {
console.log('received: %s', message);
});
However when I run this same client from my home Windows 7 while the server is remote Ubuntu one, it is not able to connect:
> $ node c2.js events.js:85
> throw er; // Unhandled 'error' event
> ^ Error: connect ENETUNREACH
> at exports._errnoException (util.js:746:11)
> at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
I've even run this code in Google Chrome :
var ws = new WebSocket("ws://[2600:3c00::f03c:91ff:fe73:2b08]:31333");
ws.onerror = function(err)
{
console.log(err);
alert("Connection is error...");
};
But I get the same error:
WebSocket connection to 'ws://[2600:3c00::f03c:91ff:fe73:2b08]:31333/' failed: Error in connection establishment: net::ERR_ADDRESS_UNREACHABLE websocket.html:37 Event
What could be the issue?
PS: at the moment I've stopped the server at port 31333.
ws://[::1]:31333seems to work as expected (Chrome 44.0.2403.125, Linux). - Rob Wping -6 ipv6.google.com(or on Linux:ping6 ipv6.google.com)? Then you've found your problem, and you should try to get IPv6 connectivity (this is not an issue with Chrome or your application, but your network). - Rob W