简体   繁体   中英

Using the Socket.IO framework with native WebSocket clients

I am looking to leverage my existing (and quite simple) NodeJS+SocketIO server application with a new Android based client. This is not using the WebKit browser, but a native WebSocket client within the Android SDK.

I have found the library "Weberknecht" and loaded it into my Android project, and when I attempt a connection to the WebSocket URL I see a "WARN - client not handshaken client should reconnect" message in my NodeJS trace.

Presumably the SocketIO framework does some extra work pre-WebSocket and that is why I am having issues. Has anyone else done this kind of "cross-library" work against SocketIO, and if so could you offer any assistance please.

If you are still looking for an answer, then checkout out https://github.com/koush/android-websockets , which got released recently. It has full support for socket.io server running in node.js

There is already a Java client for Socket.IO, you can look at the different port at the wiki page . Also, there is a description of the socket.IO protocol on the wiki page.

It seems like the first thing that Java port does when it connects is that it sends a "1::(path)" connect message. Are you sending the connect message?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM