Is there any Socket.IO-client available for Java? So far I have only found the official Socket.IO client which is only available for JavaScript and socket.io-java which is only the server.
7 Answers
Limited options at this time:
sound right as far as WebSockets go. Socket.IO's specific wire protocol do not appear to have been implemented in Java yet, so you may have to deal with that yourself.
-
1I finally went with Java-WebSocket by TooTallNate and implemented the Socket.IO-specific stuff myself. – Teo Klestrup Röijezon Apr 26 '11 at 00:19
-
Nice. Would love to hear how that worked out for you: are you using Java on both the client and the server, or java on the client and something like Node.js on the server? – Femi Apr 26 '11 at 06:37
-
I'm using Java on the desktop client, JavaScript (of course) on the web clients, and Python on the server. – Teo Klestrup Röijezon Apr 26 '11 at 09:10
-
1@DontCare4Free Have you open-sourced your Socket.io Java client? – Kevin Jul 31 '11 at 08:52
-
@Kevin, https://github.com/dontcare4free/blservermanager-client/blob/master/src/main/java/tk/dontcare4free/blservermanager/Client.java, although I've had reports of it not working too well with the official node socket.io server. – Teo Klestrup Röijezon Jul 31 '11 at 19:33
-
I cant compile the socket.io-java-client project with ant. – Jānis Gruzis Jul 05 '12 at 13:12
-
Note that the Gottox client does not support the XHR-Transport protocol. – Erel Segal-Halevi Feb 12 '13 at 09:43
Judging from http://socket.io under "Supported Transports" it could be several different transport protocols:
WebSocket, Adobe® Flash® Socket, AJAX long polling, AJAX multipart streaming, Forever Iframe, JSONP Polling
So, the question is, what is your server supporting?
From the perspective of Java clients the easiest would be WebSockets.

- 79,991
- 11
- 123
- 154
-
Yes, the server supports WebSockets. I'm not sure though about if socket.io does any own magic or just connecting directly should do. – Teo Klestrup Röijezon Apr 25 '11 at 21:10
If you need a client side implementation, checkout java-socket.io.client I made it a few months ago and I believe some people have forked it and upgraded it to the latest version: https://github.com/clwillingham/java-socket.io.client

- 43
- 1
- 6
There is an other Library it is Jetty: http://www.eclipse.org/jetty/documentation/current/jetty-websocket-client-api.html

- 36
- 2
Take a look at http://techdroid.kbeanie.com/2011/03/websockets-on-android.html. I only needed the WebSockets, so I stripped out the WebView part as well, the Factory was superfluous also. You can just get away with using https://github.com/anismiles/websocket-android-phonegap/blob/master/src/com/strumsoft/websocket/phonegap/WebSocket.java and implement the SocketIO specifcs yourself.

- 1,480
- 1
- 13
- 17