Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 397
Tiwari Avatar asked Jan 18 '11 06:01

Tiwari


2 Answers

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.

like image 122
Moishe Lettvin Avatar answered Sep 30 '22 16:09

Moishe Lettvin


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.

like image 23
schibum Avatar answered Sep 30 '22 14:09

schibum