A really simple WebSocket library that works with node.js, Atmosphere or any WebSocket server! As simply as
WebSocket().open("ws:https://localhost")
.listener(new MessageListener {
override def onMessage(message: String) {
// Do something
}
})
.send("Hello World")
.send("WebSockets are cool!")
.listener(new MessageListener {
override def onMessage(message: Array[Byte]) {
// Do something
}
})
.send("Hello World".getBytes)
Download using Maven
<dependency>
<groupId>org.jfarcand</groupId>
<artifactId>wcs</artifactId>
<version>1.3</version>
</dependency>
or a single artifact that contains all its dependencies
<dependency>
<groupId>org.jfarcand</groupId>
<artifactId>wcs-all</artifactId>
<version>1.3</version>
</dependency>