GitHunt
ST

studerw/spring-boot-websocket-example

This is a simple example of a Spring Boot application using Websockets and the STOMP protocol to implement a simple chat application

Spring Boot Websocket Chat Example

This is a simple Spring Boot web app that demonstrates using Websockets and STOMP protocol to implement a simple Chat Server.
The Chat Html and Javascript.

It requires Java 8.

spring-boot-websocket-example

Building the Project

  • Windows: mvnw.cmd clean install
  • Linux/Mac:
    • chmod u+x ./mvnw
    • ./mvnw clean install

Run Locally

  • Windows: mvnw.cmd spring-boot:run
  • Linux/Mac: ./mvnw spring-boot:run

The following test can be run from the command line:
curl -vk http://localhost:8080/ping

Should get a pong response

Running the Chat Application

In your browser, open up two tabs, both to http://localhost:8080/chat.html.

From within each tab, send chat messages. You should see the messages appear in both tabs.

Languages

Java56.5%HTML34.1%CSS9.5%

Contributors

Apache License 2.0
Created January 13, 2021
Updated October 1, 2021
studerw/spring-boot-websocket-example | GitHunt