Google app engine Channel API for COMET on non Javascript clients
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 HTT开发者_运维知识库P 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.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.
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.
If you want bi-directional updates from a non-JS client, you can use XMPP.
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
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.
精彩评论