node.js服务器:
io.set('transports', ['websocket', 'xhr-polling', 'jsonp-polling', 'htmlfile', 'flashsocket']);
io.set('origins', '*:*');
JAVA服务器:
Configuration config = new Configuration();
config.setTransports(Transport.POLLING, Transport.WEBSOCKET);
config.setOrigin(":*:");
客户端:
var socket = io.connect('http://127.0.0.1:8081',{transports:['websocket','xhr-polling','jsonp-polling']});