从android客户端发送套接字请求到sails.js 0.11

lui*_*dez 2 sockets android node.js sails.js

有任何想法如何在android中制作socket.get()请求?

我试试这个:

JSONObject obj = new JSONObject();
obj.put("url","/controller/action");
socketClient.emit("get",obj);
Run Code Online (Sandbox Code Playgroud)

服务器响应是:

Error (SAILS:HOOK:SOCKETS:PARSE_VIRTUAL_REQ):: Failed to parse incoming socket.io request
...
details: 'Sails v0.11.x is not compatible with the socket.io/sails.io.js client SDK version you are using (0.9.0). Please see the v0.11 migration guide on http://sailsjs.org for more information.'
Run Code Online (Sandbox Code Playgroud)

str*_*s95 5

只需将您的网址更改为以下内容即可

http://xxx.xxx.xxx.xxx:1234/?__sails_io_sdk_version=0.11.0
Run Code Online (Sandbox Code Playgroud)