Skip to content

Simple implementation of a websocket server which enables an adhoc communication with connected clients via command line.

Notifications You must be signed in to change notification settings

hsperker/conversational-websocket-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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' ⏎

About

Simple implementation of a websocket server which enables an adhoc communication with connected clients via command line.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages