Skip to content

Socket.IO server implemented on Java Spring Boot example project

Notifications You must be signed in to change notification settings

hourmeng12/socket-io-with-spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Socket.IO server implemented on Java Spring Boot example project

Topics

Resources

Stars

Watchers

Forks

Languages