I'd like to run a p2p chat written in node js with socket io on GAE.
My app works locally fine but I get error messages when I run it on the GAE servers related to the socket io I think.
Here are the two relevant script tags of my local client.html
when running locally:
<script src="/socket.io/socket.io.js"></script>
<!-- <script src="https://cdn.socket.io/socket.io-1.2.0.js"></script> -->
<script type="text/javascript">
// our socket.io code goes here
var socketio = io.connect("127.0.0.1:1337");
socketio.on("message_to_client", function (data) {
to_history(data['message']);
});
function send_message() {
var msg = [document.getElementById("text1").value, user1, uuid];
socketio.emit("message_to_server", {
message: msg
});
}
</script>
I've seen blogs/posts saying that for deployment I need to allow a firewall rule here on SO (which is in place now). I also tried pointing my deployed app to a static external IP like (after making it static in my google cloud console):
var socketio = io.connect('https://104.197.51.XXX')
or to point it to the port 65080 specified in my firewall rule (see documentation by google here:
var socketio = io.connect('https://104.197.51.XXX:65080')
None of this works.
I have the html loaded fine and the jQuery part I have and css is also loading just fine. It's just the socket stuff that I seem to be getting wrong. What do I have to change?
If this is of use, here the app.yaml:
runtime: nodejs
vm: true
Any help is greatly appreciated. Thanks.