Comments (5)
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.
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.
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.
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
from appengine-nodejs-quickstart.
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)
- appengine logs HOT 1
- websocket
- Change default port HOT 1
- `app.yum` routes to `app.js` when it doesn't exist HOT 2
- Nodejs 0.12
- Service Unavailable HOT 5
- Console Logging Not Working HOT 4
- Problem Running PhantomJS + Node Module HOT 12
- ERROR: (gcloud.preview) Invalid choice: 'app'. HOT 3
- Error building docker image rr-eap.default.1 when trying to deploy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appengine-nodejs-quickstart.