SPRING
2018.03.21 / 01:45

A Spring-based WebSocket Chat Server

ÈÞ°í
Ãßõ ¼ö 212

https://github.com/jaysridhar/spring-websocket-server


Spring-based WebSocket Chat Server

Demonstrates Spring WebSocket Server. Sample code based off of Spring Guide with a few changes.

The package includes a Web client which can be used to exercise the functionality.

Build the software as follows:

mvn clean package

Run it as follows, changing the port to 9090:

java -Dserver.port=9090 -jar target/chat-server-0.1.0.jar

Connect to the web client at: http:://:9090/.

For a demo Spring Java Client, see [https://github.com/jaysridhar/spring-websocket-client].




Spring WebSocket Chat Client


Spring WebSocket Chat Client

A sample implementation demonstrating usage of Spring WebSockets for the client. For a compatible server implementation, see [https://github.com/jaysridhar/spring-websocket-server]. The server includes a web-based client (HTML/JS), however this client demonstrates usage of WebSockets from Java in the Spring context.

Build the project using:

mvn clean package

And run it as follows:

java -jar target/chat-client-0.1.0.jar

The client connects to the server on the localhost at port 9090, send a starting message and shows a prompt on the console which can be used to send further messages. Any messages sent to the server (maybe from a second console or the web client) is also received and echoed on the console.