运行Gottox / socket.io-java-client时出错

嗨所以我试图从Gottox运行socket.io-Java客户端,只需打开项目在eclips(导入),并运行BasicExample.java我得到这个错误

握手时出错服务器返回的HTTP响应码为400:URL: http:// localhost:3000 / socket.io / 1 /

我尝试了很多解决scheme,但无法运行它,我也运行端口3000上的nodejs服务器。

var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); app.get('/', function(req, res){ res.sendfile('index.html'); }); io.on('connection', function(socket){ console.log('a user connected'); socket.on('message', function(msg){ io.emit('message', msg); console.log('1111111111111111111'); }); }); http.listen(3000, function(){ console.log('listening on *:3000'); }); 

在节点服务器上安装一个旧版本(<1.0)的socket.io:

 npm uninstall socket.io npm install -g socket.io@0.9.17 

我在我的项目中使用了Gottox库,它似乎不适用于socket.io版本1.0+

更新的Java版本的socket.io库,可以在版本1.0以上使用