如何在 GAE 之上运行 WebSocket 服务器? [英] How can I run a WebSocket server on top of GAE?

查看:33
本文介绍了如何在 GAE 之上运行 WebSocket 服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Google App Engine 上运行 WebSocket 服务器?是否可以?有可能吗?

How can I run a WebSocket server on top of Google App Engine? Is it possible? Will it be possible?

推荐答案

有可能吗?

没有

您现在不能,因为 GAE 不允许通用入站套接字连接.每个请求也被限制为 30 秒,但这可以通过自动重新连接和会话跟踪轻松解决.

You can't right now because GAE doesn't allow generic inbound socket connections. Each request is also limited to 30 seconds but this could easily be worked around with automatic reconnection and session tracking.

有可能吗?

可能.

Google 一直是 WebSockets 标准的最大(主要)推动者之一.如果他们在未来的某个时候不将对其的支持推送到 GAE,我会感到惊讶.请注意,WebSockets 标准草案仍在不断变化,因此在标准更加可靠之前,Google 可能会犹豫是否添加支持.

Google has been one of the biggest (main) promoters of the WebSockets standard. I would be surprised if they don't push support for it into GAE at some point in the future. Note that the WebSockets draft standard is still in flux so Google might be hesitant to add support before the standard is more solid.

以下是 GAE 上 WebSockets 支持的错误:http://code.google.com/p/googleappengine/issues/detail?id=2535

Here is the bug for WebSockets support on GAE: http://code.google.com/p/googleappengine/issues/detail?id=2535

请注意,谷歌员工表示它不在路线图上,但他们知道这会很有用.这与您从 google 获得的有关尚未公布的功能的答案一样肯定.我建议将您的声音添加到该错误中,以支持 WebSocket.不会痛.

Note that a google employee indicates it's not on the roadmap but that they know it would be useful. That's about as positive an answer as you get from google about features that have not been announced. I recommend adding your voice to that bug in favor of WebSocket support. It can't hurt.

此外,根据您的应用程序,您可以考虑可能很快会支持 GAE 的 Channel API:

Also, depending on your application, you may consider the Channel API which will likely have GAE support soon:

编辑(2015 年):Channels API 现在可用(已经有一段时间了).

EDIT (2015): the Channels API is available now (it has been for a while).

这篇关于如何在 GAE 之上运行 WebSocket 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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