lundi 23 novembre 2020

Ember JS 3.20 app with SailsJS 0.12.x backend and websocket connection

I am using sails 0.12.14 version back-end with EmberJS 3.20 front-end. I am currently dealing with a websocket connection problem in production.

Using "sails.io.js": "^1.1.0", "socket.io-client": "^1.4.5" for sails compatibility in Ember ( same goes for sails back-end ).

Both servers are on AWS. When i use app in development (localhost), everything is OK, socket is connected, messages are pushed from back-end to fron-end via socket. But when i deploy Ember app to production, i get this:

WebSocket connection to 'ws://{my-page-domain}/socket.io/?__sails_io_sdk_version=1.1.0&__sails_io_sdk_platform=node&__sails_io_sdk_language=javascript&EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400

Where is this comming from and why can't ember app access sails.io ? Back-end is running just fine.

Any idea what is happening ?

Any insight whatsoever is appreciated.




Aucun commentaire:

Enregistrer un commentaire