general problems with the channel api

74 views
Skip to first unread message

CAA

unread,
Sep 23, 2011, 5:19:55 AM9/23/11
to google-a...@googlegroups.com
hi everyone

i have a problem with my javascript of the client... i cant create Channels when the programm is running on the google servers.
on the lokal developmentserver i get the same error, but it all works just fine - while on the server its just a dead cow.

okay, first, here is the code, but its sort of like in the

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html {
    height: 100%
}

body {
    height: 100%;
    margin: 0;
    padding: 0
}

#map_canvas {
    height: 100%
}
</style>
<script type="text/javascript"    src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src='/_ah/channel/jsapi'></script>
<script type="text/javascript">
function initialize() {
        var getTokenURI = './gettoken?userid=myUserName';
        var httpRequest = makeRequest(getTokenURI,true);
        httpRequest.onreadystatechange = function(){
            if (httpRequest.readyState === 4) {
                if (httpRequest.status === 200) {
                    openChannel(httpRequest.responseText);
                }else {
                   
                }
            }
        }

}


openChannel = function(token) {
        var channel = new goog.appengine.Channel(token);
        var socket = channel.open();
        socket.onopen = onSocketOpen;
        socket.onmessage = onSocketMessage;
        socket.onerror = onSocketError;
        socket.onclose = onSocketClose;
        alert('OpenChannel end');
    };


//other for the problem probably unimport functions ;-)

</script>
</head>
<body onload="initialize()">
.
.
.



on the line
var channel = new goog.appengine.Channel(token);
i get the Error:
"Fehler: goog is not defined"
(Fehler is german and means error)
on that line the javascript stops to work and nothing else happens behind/under it (for example alert("qwertz");)

did anyone encounter this problem in the past or has a hunch how to solve this?


also the codelab example seems not to work correctly when its online.
a "logged in" user doesnt get to know when theres a new user in the system - and when the new user sends a message to the first user, he does not get the message(s)
like above, when i run it on the lokal development server it works just fine.

are there some configurations which need to be done for the channel service to work proper, which ive just overseen?

CAA

unread,
Sep 28, 2011, 2:54:43 AM9/28/11
to google-a...@googlegroups.com
The Solution is that
<script src='/_ah/channel/jsapi'></script>
refers to
https://talkgadget.google.com/talkgadget/channel.js
which is on the blacklist of the proxy


Reply all
Reply to author
Forward
0 new messages