Search code examples
javascriptgoogle-app-enginecross-domainchannel-api

Is it possible to connect from another domain to my App Engine with the Channel API


I want a cross domain communication from my site to the backend at App Engine with the Channel . Is this possible and if so how? Because there is no domain parameter in the Javascript API


Solution

  • Yes you can... I'm doing this myself. you dont need to do anything fancy, just include the /_ah/channel/jsapi script from the domain of the app-engine app, and it should work

    EXAMPLE: from http://mysite.com/index.html

    <head>
        <script language="javascript" type="text/javascript" src="http://myapp.appspot.com/_ah/channel/jsapi"></script>
    </head>
    

    then use the Channel API normally https://developers.google.com/appengine/docs/python/channel/javascript