Basic Spring Boot WebSocket application that sends a JSON message to a client.
157
This project is a basic Spring Boot WebSocket application that sends a JSON message to a client when a WebSocket connection is established. Additionally, it includes an HTTP controller that serves a static HTML page where the WebSocket message can be received in real-time.
WebSocket Endpoint:
/ws/hello{"message": "Hello World from WebSocket in Java"}HTTP Endpoint:
/Technologies used in this project:
Follow these steps to install and run the project:
Ensure you have the following tools installed:
java -version
mvn --version
Copy the repository
git clone https://github.com/nava2105/jar_websocket.git
Enter the directory
cd ../jar_websocket
Compile the project directly form mvn
mvn spring-boot:run
Open a browser and enter to http://localhost:8080
Or to review the endpoints in Swagger enter to http://localhost:8080/swagger-ui/index.html
Pull the image from Docker-hub
docker pull na4va4/jar_websocket
Start a container from the image
docker run -p 8080:8080 na4va4/jar_websocket
Open a browser and enter to http://localhost:8080
Or to review the endpoints in Swagger enter to http://localhost:8080/swagger-ui/index.html
Content type
Image
Digest
sha256:4cf1fa62c…
Size
234.4 MB
Last updated
almost 2 years ago
docker pull na4va4/jar_websocket