Google Cloud Functions with socket.io

Deadly 提交于 2019-12-23 03:35:16

问题


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.

Is Cloud Run with a running Node.js server the best option to handle multiple socket connections using socket.io ?


回答1:


Neither Cloud Functions nor Cloud Run are able to support persistent socket connections for the same reasons. Each request has a timeout that can't be infinite. If you want to use socket.io effectively, you will need a different backend - one where you fully control the server instances.



来源:https://stackoverflow.com/questions/56476666/google-cloud-functions-with-socket-io

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!