Java server and socket.io

user1081056 picture user1081056 · Mar 1, 2012 · Viewed 10.3k times · Source

Are there any examples(ready scripts) to connect to java server with socket.io library? My problem: I have a server that works on java (proceed some data from clients) and a java client that is always connected to server (server is to be informed when a client is disconnected). I want to create a javascript extension for google chrome that replace this java client. But now server and client communicate now with simple text protocol.

Answer

Ali Raza picture Ali Raza · Mar 1, 2012

There are several java libraries that provide java's connectivity with socket.io client.

Servers

  1. ibdknox/socket.io-netty (NOTE: not updated since 2011, not compatible with socket.io v0.7 or above)
  2. avostryakov/Socket.IO-Java (a fork of Ovea/Socket.IO-Java which is no longer available)
  3. mrniko/netty-socketio
  4. Atmosphere/atmosphere (see Getting-Started-with-Socket.IO)
  5. trinopoty/socket.io-server-java (based on the official engine.io Java server but modified for normal socket.io)

The trinopoty and mrniko servers are both mentioned on the official docs for socket.io under "other server implementations".

Clients

  1. Official Java client
  2. benkay/java-socket.io.client (NOTE: no longer maintained)
  3. Gottox/socket.io-java-client (NOTE: repository has now been archived)