Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的理解是,要使用 socket.io 建立持久的套接字连接,Node.js 服务器应该始终运行。使用 Google Cloud Functions 并没有始终运行的 Node.js 服务器,因此无法保持套接字连接处于活动状态。
使用正在运行的 Node.js 服务器的 Cloud Run 是使用 socket.io 处理多个套接字连接的最佳选择吗?
更新:从 2021 年 1 月起,GCP Cloud Run 支持 WebSockets。
这是 Cloud Run 文档的链接
这是博客文章的链接(他们的公告)