带有 socket.io 的谷歌云函数 [英] Google Cloud Functions with socket.io
本文介绍了带有 socket.io 的谷歌云函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的理解是,要使用 socket.io 建立持久的套接字连接,Node.js 服务器应该始终运行.使用 Google Cloud Functions 并没有始终运行的 Node.js 服务器,因此无法保持套接字连接处于活动状态.
My understanding is that to establish a persistent socket connection using socket.io the Node.js server should be always running. With Google Cloud Functions there isn't an always running Node.js server, so keeping a socket connection alive is not possible.
带有运行 Node.js 服务器的 Cloud Run 是使用 socket.io 处理多个套接字连接的最佳选择吗?
Is Cloud Run with a running Node.js server the best option to handle multiple socket connections using socket.io ?
推荐答案
更新:从 2021 年 1 月起,GCP Cloud Run 支持 WebSockets.
UPDATE: From January 2021, GCP Cloud Run supports WebSockets.
这篇关于带有 socket.io 的谷歌云函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文