Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i use Socket.io with Spring-boot?

I am gonna develop a real time game for andriod/ios and i need a server which transmit data with client real time. Can i use socket.io with Spring boot? Or if the answer is no , using websockets with Spring boot is the solution?

like image 636
Maziar Karimi Avatar asked Aug 15 '19 06:08

Maziar Karimi


People also ask

What can Socket.IO be used for?

Socket.IO is a library that enables low-latency, bidirectional and event-based communication between a client and a server. It is built on top of the WebSocket protocol and provides additional guarantees like fallback to HTTP long-polling or automatic reconnection.

Is Socket.IO different from WebSocket?

WebSocket is a technology that enables two-way realtime communication between client and server. In contrast, Socket.IO is a library that provides an abstraction layer on top of WebSockets, making it easier to create realtime applications.

Can you use Socket.IO with Express?

Socket.IO can be used based on the Express server just as easily as it can run on a standard Node HTTP server. In this section, we will fire the Express server and ensure that it can talk to the client side via Socket.IO.


1 Answers

The original Socket.IO server is designed to be used in Javascript, mostly Node.

Yet, there are other implementations of the Socket.IO server for other languages.

For Java, there is the Netty-socketio project, an open-source Java implementation of the Socket.IO server, based on the Netty Java server framework (the Netty-socketio project is also suggested in this answer).

This example Spring Boot application uses Netty-socketio to provide a Socket.IO server within a Spring Boot application.

So yes, you can use (on open-source Java implementation) of Socket.IO together with Spring Boot.

like image 156
Markus Weninger Avatar answered Oct 25 '22 10:10

Markus Weninger