Code Monkey home page Code Monkey logo

Comments (5)

rrch avatar rrch commented on June 27, 2024

https works a bit differently in appengine. See https://cloud.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Secure_URLs.

In server.js, you should expose everything via port 8080. Then in the app.yaml file you can mark certain urls (or all of them) as "secure: always". If you do that, when you deploy your app in production, it'll require clients to go through https.

from appengine-nodejs-quickstart.

sasivarunan avatar sasivarunan commented on June 27, 2024

If i expose only 8080 and if i try to connect socketIO using
socket = io("https://mydomain.appspot.com")
I'm getting
wss://mydomain.appspot.com/socket.io/?EIO=2&transport=websocket&sid=-jBxksFbPh-A-MpiAAAA' failed: Error during WebSocket handshake: Unexpected response code: 400
Reason im getting this error is:
I'm listening only to 8080 inside the js code not 8443
var server = require('http').createServer(app).listen(8080);
If i want to listen 8443, i should pass option parameters with ssl files. But this same setup works in compute engine!

Is there any other way i can serve the key files in appengine?
var options = {
key: fs.readFileSync('static/ssl.key'),
cert: fs.readFileSync('static/ssl.crt')
};

from appengine-nodejs-quickstart.

rrch avatar rrch commented on June 27, 2024

You're getting an error during the handshake because the App Engine frontend does not support web sockets. Did you manage to serve the key files over https?

In Managed VMs, you can use web sockets, but to do so you have to change the firewall configuration to allow traffic on the specific port you want to use. It's pretty much the same thing you'd do on Compute Engine. This sample shows how to do it in Java: https://github.com/GoogleCloudPlatform/appengine-websocketchat-java. I don't think you'll be able to test it in the SDK though, because we only forward port 8080 from the container.

from appengine-nodejs-quickstart.

sasivarunan avatar sasivarunan commented on June 27, 2024

I've the similar set up in my Compute engine instance and wss socket connection over https works.
I tied that JAVA link by allowing all the ports in default network tcp but still it doesn't work

var secureServer = require('https').createServer(options,app).listen(8443);
var server = require('http').createServer(app).listen(8080);
var sio = require('socket.io');
io = sio.listen(secureServer);

Source Ranges:
0.0.0.0/0
Allowed Protocols or Ports:
tcp:1-65535
udp:1-65535
icmp

When i ssh in to my google managed instance and do=> docker ps

screen shot 2014-10-02 at 8 14 42 pm

from appengine-nodejs-quickstart.

thebergamo avatar thebergamo commented on June 27, 2024

Have an answer for this issue? I'm have the same problem.. and i don't have idea how I fix it. :(

from appengine-nodejs-quickstart.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.