Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 941 Bytes

README.md

File metadata and controls

58 lines (37 loc) · 941 Bytes

Conversational Websocke Server

Starts a websocket server (JSR-356) and command line interface to communicate with connected clients.

The server listens by default on port 8080 but might be changed via Spring profile or arguments.

The default WS endpoint is /api/ws/

As a test client Telsocket might be used.

Used Libraries

  • spring-boot-starter-web
  • spring-websocket
  • spring-shell-starter

Build & Run

Run through maven:

$ mvn spring-boot:run  

Build and run as standalone:

$ mvn clean package
...
$ java -jar cws.jar 

Commands

The following commands are implemented.

Clients

List all connected clients by session id.

clients ⏎

Broadcast

Send a message as broadcast to all connected clients.

broadcast 'hello to all' ⏎

Unicast

Send a message as unicast to a specific client.

unicast 0 'hello client 0' ⏎