I'm running Sails.js (v0.11.0) on a Managed VM in Google App Engine, everything works fine provided I disable sockets. I am using the default Sails project, with one model (User) with no custom attributes and am simply visiting the home page in my browser. I see the following in Chrome's console window;
WebSocket connection to 'ws://localhost:8080/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_sdk_platform=browser&__sails_io_sdk_language=javascript&EIO=3&transport=websocket&sid=GShPZd_tjzqnrigNAAAA' failed: Error during WebSocket handshake: 'Upgrade' header is missing
sails.io.js:143
|> Now connected to Sails.
\___/ For help, see: http://bit.ly/1DmTvgK
(using browser SDK @v0.11.0)
4(index):1 Font from origin 'http://sailsjs.org' has been blocked from loading by Cross-Origin Resource Sharing policy: The 'Access-Control-Allow-Origin' header contains the invalid value ''. Origin 'http://localhost:8080' is therefore not allowed access.
sails.io.js:4 POST http://localhost:8080/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_s…ascript&EIO=3&transport=polling&t=1427404282042-3&sid=GShPZd_tjzqnrigNAAAA 503 (Service Unavailable)
sails.io.js:143 Failed to connect socket (probably due to failed authorization on server) Error: Error: xhr post error {type: "TransportError", description: 503, stack: (...), message: "xhr post error"}
sails.io.js:143 ====================================
sails.io.js:143 Socket was disconnected from Sails.
sails.io.js:143 Usually, this is due to one of the following reasons:
-> the server was taken down
-> your browser lost internet connectivity
sails.io.js:143 ====================================
sails.io.js:143
Socket is trying to reconnect to Sails...
_-|>_- (attempt #1)
sails.io.js:4 POST http://localhost:8080/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_s…ascript&EIO=3&transport=polling&t=1427404302073-4&sid=GShPZd_tjzqnrigNAAAA 503 (Service Unavailable)
sails.io.js:4 GET http://localhost:8080/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_s…sails_io_sdk_language=javascript&EIO=3&transport=polling&t=1427404303080-5 503 (Service Unavailable)
'Upgrade header is missing' seems like it may be the culprit, but I don't understand how the headers could have been changed from whatever Socket.io requires, I have an app.yaml file that simply allows passes all traffic to sails.
#app.yaml
module: default
version: 1
runtime: custom
api_version: 1
vm: true
manual_scaling:
instances: 1
handlers:
- url: /.*
script: app.js
Any help greatly appreciated!
Cheers! R.