我可以在 Spring-boot 中使用 Socket.io 吗? [英] Can i use Socket.io with Spring-boot?

查看:67
本文介绍了我可以在 Spring-boot 中使用 Socket.io 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要为 Android/ios 开发一个实时游戏,我需要一个与客户端实时传输数据的服务器.我可以在 Spring Boot 中使用 socket.io 吗?或者,如果答案是否定的,那么在 Spring Boot 中使用 websockets 是解决方案吗?

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?

推荐答案

最初的 Socket.IO 服务器旨在用于 Javascript,主要是 Node.

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

然而,还有其他语言的 Socket.IO 服务器实现.

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

对于 Java,有 Netty-socketio 项目,这是一个开源 Java 实现Socket.IO 服务器,基于 Netty Java 服务器框架(Netty-socketio 项目也在 这个答案).

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).

此示例 Spring Boot 应用 使用 Netty-socketio 提供 Socket.IOSpring Boot 应用程序中的服务器.

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

所以是的,您可以(在开源 Java 实现上)将 Socket.IO 与 Spring Boot 一起使用.

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

这篇关于我可以在 Spring-boot 中使用 Socket.io 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆