非 Javascript 客户端上用于 COMET 的 Google 应用引擎 Channel API
如何使用 Google 应用引擎Channel API 对于非 JavaScript 客户端上的 COMET。
我将用 python 或任何其他语言编写客户端,并且可以从客户端执行 HTTP 或 Socks。
我该如何继续,我想知道 JavaScript 客户端支持发生了什么?
JS 是使用长轮询还是与 GAE 服务器对话。
How to use Google app engine Channel API for COMET on non JavaScript clients.
I shall be writing a client in python or any other language, and can do HTTP or Socks from client.
How shall I proceed, I want to know what is happening in backed of JavaScript client?
Is JS using Long Polling or what to talk to GAE server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
异步消息传递是通过在页面中嵌入隐藏的 iframe 来完成的,然后使用 Google Closure javascript 库中的 goog.net.CrossPageChannel 类将消息从 iframe 发送到主机页面。
Closure CrosspageChannel 代码记录如下:http://closure-library.googlecode.com/svn/!svn/bc/4/trunk/closure/goog/docs/class_goog_net_xpc_CrossPageChannel.html
您可以轻松地对将要发送的消息进行逆向工程从 iframe 传递到主页。这些可能不会改变(尽管目前还不能绝对保证)。
我希望在本季度开源 Channel API 的客户端库,但以上内容应该可以帮助您入门。
The asynchronous message passing is done by embedding a hidden iframe in the page, then using the goog.net.CrossPageChannel classes from the Google Closure javascript library to send messages from the iframe to the host page.
The Closure CrosspageChannel code is documented here: http://closure-library.googlecode.com/svn/!svn/bc/4/trunk/closure/goog/docs/class_goog_net_xpc_CrossPageChannel.html
You can easily reverse-engineer the messages that'll be passed up from the iframe to the host page. These probably won't change (though there's no absolute guarantee of that right now).
I'm hoping to open-source the client library for the Channel API this quarter, but the above should get you started.
我对 javascript Channel API 客户端进行了逆向工程,并创建了一个 Python 库。
请随意使用它。我还没有在任何实际应用程序上测试过它,但从我所看到的来看,它似乎工作得很好。
I've reverse-engineered the javascript Channel API client and created a python library.
Feel free to use it. I haven't tested it on any real-world application yet, but from what I can see it seems to work quite well.
如果您希望从非 JS 客户端进行双向更新,可以使用 XMPP。
If you want bi-directional updates from a non-JS client, you can use XMPP.
Google App Engine 尚未发布任何有关 Channel API 背后协议的文档,因此没有开发 Javascript 语言之外的库(这里是 Gwt)。
如果您有兴趣,可以为这些功能请求加注星标:
4189 - 允许 Java 客户端(不仅仅是 javascript)使用 Channel API
4226 - 适用于本机客户端应用的 Channel API?
4206 - 为 Channel API 创建原生 C# 客户端库
Google App Engine has not yet published any documentation about the protocol behind the Channel API so there's no development of libraries outside the Javascript language (here a wrapper for Gwt).
If you are interested you could star these feature requests:
4189 - Enable Java clients (not just javascript) to use the Channel API
4226 - Channel API for native client apps?
4206 - Create a native C# client library for the Channel API
酷,...我在 Google I/O 的应用程序引擎演讲中发现了“channel api”的 X-Ray 视图
http://www.youtube.com/watch?v=oMXe-xK0BWA
它使用隐藏的 Iframe
http://en.wikipedia.org/wiki/Comet_(programming)#Hidden_iframe
现在我将尝试用 python 或其他东西来模仿客户端。
Cool,... I found an X-Ray view of "channel api" on the app engine talk og Google I/O
http://www.youtube.com/watch?v=oMXe-xK0BWA
It uses hidden Iframe
http://en.wikipedia.org/wiki/Comet_(programming)#Hidden_iframe
Now i will try to imitate th client in python or something.