node.js+express+socket.io with ipv6?

Problem

I have my code like below:

var gzippo = require('gzippo');

var app = require('express').createServer()
, io = require('socket.io').listen(app);

io.enable('browser client gzip');
io.set('transports', [
'websocket'
]);

app.use(gzippo.staticGzip(__dirname + '/'));

app.listen(8001);

app.get('/', function (req, res) {
res.sendfile(__dirname + '/main2.html');
});

io.sockets.on('connection', function (socket) {...});

I use gzippo for gzip, express for http server, socket.io for websocket function.

The code beyond now work properly with requests from a ipv4 address.

So how to listen a request from my ipv6 address?

Problem courtesy of: liuyanghejerry

Solution

It appears that socket.io fails to connect as it is unable to parse ipv6 url, cf https://github.com/LearnBoost/socket.io-client/issues/260

Solution courtesy of: First Zero

View additional discussion.