-
Notifications
You must be signed in to change notification settings - Fork 23
https dosen't work #13
Comments
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. |
If i expose only 8080 and if i try to connect socketIO using Is there any other way i can serve the key files in appengine? |
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. |
I've the similar set up in my Compute engine instance and wss socket connection over https works. var secureServer = require('https').createServer(options,app).listen(8443); Source Ranges: When i ssh in to my google managed instance and do=> docker ps |
Have an answer for this issue? I'm have the same problem.. and i don't have idea how I fix it. :( |
my dir includes
Dockerfile app.yaml package.json server.js static
and static dir has crt and key files
app.yaml has
handlers:
static_files: static/\1
upload: static/(..(html|css|key|crt))
script: app.js
I'm taking options value for https as referred here http://nodejs.org/api/https.html
var options = {
key: fs.readFileSync('static/ssl.key'),
cert: fs.readFileSync('static/ssl.crt')
};
var secureServer = require('https').createServer(options,app).listen(8443);
var server = require('http').createServer(app).listen(8080);
app.get('/', function(req, res) {
res.send('Hello, world ');
});
if i try node server.js
https://localhost:8443 works fine (Identity not verified, as i'm running locally)
but when i try to run this in gcloud preview app run .
only localhost:8080 works https doesn't. (no webpage found.)
How do i get this working? Thanks
The text was updated successfully, but these errors were encountered: