/socket-io-with-spring-boot

Socket.IO server implemented on Java Spring Boot example project

Primary LanguageJava

Spring Boot with Socket.IO

SpringBoot ApacheKafka

An example Spring Boot project built with Netty Socket.IO

Setup

application.yml expose your socket server

socket-server.host should be a static ip to expose for other client beside local client

in this case, it is local client only

socket-server:
  port: 8085
  host: 127.0.0.1

Run the project with maven or on your ide

./mvnw.cmd

Demonstration

Client 1

Create a Socket.IO request using either Postman or socket.io client of your choice

  • url ws://localhost:8085?room=1

  • listening event get_message

  • message with event name send_message

{
    "room": "1",
    "type": "CLIENT",
    "message": "hello, this is from client 1"
}

Client 2

Create a Socket.IO request using either Postman or socket.io client of your choice

  • url ws://localhost:8085?room=1

  • listening event get_message

  • message with event name send_message

{
    "room": "1",
    "type": "CLIENT",
    "message": "hello, this is from client 2"
}

Meta

Hourmeng Khy