我对 WebSocket 更感兴趣,但在阅读文档之后 here , 当我读到这篇文章时,我感到很惊讶:
The following features are not supported by App Engine flexible environment: HTTP/2 traffic to the backend service, Websockets , HTTP requests that directly access instances
我打算用 gorilla-websocket 构建一个应用程序,但现在我已经阅读了这篇文章,但我不知道如何才能完成它。 我了解 WebSocket 在 App Engine 标准环境中不受支持,但为什么在灵活环境中不支持?
最佳答案
还有其他选择:
Like the standard environment, the flexible environment does not support websockets. If you need to use websockets you can use Compute Engine or Kubernetes Engine.
如前所述here .
可以关注feature request也是。
更新:
当前 websocket 支持可用于以下语言
- python
- Java
- Node.js
但它处于测试版
文档:https://cloud.google.com/appengine/docs/flexible/python/using-websockets-and-session-affinity
关于go - 为什么 App Engine Flexible Enviroment 不允许 WebSockets 和 HTTP/2 流量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49481903/