问题
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?
回答1:
Probably this library could be useful for your needs.
By the way Socket.io will try to use WebSocket API. In case if it's not supported by the browser then Socket.io will gracefully fallback to something else.
回答2:
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.
来源:https://stackoverflow.com/questions/57505589/can-i-use-socket-io-with-spring-boot