simple-client

A simple WebSocket Java client based on JSR 356

License

License

Categories

Categories

Net CLI User Interface
GroupId

GroupId

net.wessendorf.websocket
ArtifactId

ArtifactId

simple-client
Last Version

Last Version

0.8.0
Release Date

Release Date

Type

Type

jar
Description

Description

simple-client
A simple WebSocket Java client based on JSR 356
Source Code Management

Source Code Management

https://github.com/matzew/simple-websocket-client

Download simple-client

How to add to project

<!-- https://jarcasting.com/artifacts/net.wessendorf.websocket/simple-client/ -->
<dependency>
    <groupId>net.wessendorf.websocket</groupId>
    <artifactId>simple-client</artifactId>
    <version>0.8.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.wessendorf.websocket/simple-client/
implementation 'net.wessendorf.websocket:simple-client:0.8.0'
// https://jarcasting.com/artifacts/net.wessendorf.websocket/simple-client/
implementation ("net.wessendorf.websocket:simple-client:0.8.0")
'net.wessendorf.websocket:simple-client:jar:0.8.0'
<dependency org="net.wessendorf.websocket" name="simple-client" rev="0.8.0">
  <artifact name="simple-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.wessendorf.websocket', module='simple-client', version='0.8.0')
)
libraryDependencies += "net.wessendorf.websocket" % "simple-client" % "0.8.0"
[net.wessendorf.websocket/simple-client "0.8.0"]

Dependencies

compile (1)

Group / Artifact Type Version
javax.websocket : javax.websocket-client-api jar 1.1

test (9)

Group / Artifact Type Version
io.undertow : undertow-websockets-jsr jar 1.2.0.Beta3
junit : junit jar 4.11
org.assertj : assertj-core jar 1.6.1
io.undertow : undertow-core jar 1.2.0.Beta3
org.glassfish.tyrus : tyrus-server jar 1.8.3
org.glassfish.tyrus : tyrus-container-grizzly-server jar 1.8.3
io.netty : netty-all jar 4.0.24.Final
io.vertx : vertx-core jar 2.1.4
io.vertx : vertx-platform jar 2.1.4

Project Modules

There are no modules declared in this project.

Simple WebSocket Client Build Status

DEPRECATED

Was a POC, that is no longer maintained.

The JSR 356 describes a standard API for WebSocket Server and clients, but the client API is very complex. This project aims to offer a simplified client.

Get started

Add the following to your pom.xml file:

<dependency>
  <groupId>net.wessendorf.websocket</groupId>
  <artifactId>simple-client</artifactId>
  <version>0.8.0</version>
</dependency>

The library is a simplified version of a WebSocket client, based on the JSR 356 client APIs, basically hiding some of the standard APIs for an easy and simple usage:

final SimpleWebSocketClient client =
      new SimpleWebSocketClient("ws://localhost:9999/echo");

client.setWebSocketHandler(new WebSocketHandlerAdapter() {
  @Override
  public void onOpen() {
    client.sendText("Hello"); // ship it!!
  }

  @Override
  public void onMessage(String message) {

    assertThat(message).isEqualTo("Hello");

    // close it now:
    client.close();
  }
});

// connect
client.connect();

//send a text:
client.sendText("Hello again!");

Have fun!

Versions

Version
0.8.0
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0