How to setup Nodejs with Typescript App in Ubuntu Server and Enable Websocket Communication

18 views
Skip to first unread message

Anand Thurubatla

unread,
Dec 20, 2019, 12:45:56 PM12/20/19
to nodejs
Hi All,

We have a problem in establishing Websocket communication between Nodejs Server ( Expressjs + Typescript Template ) and Angular App deployed in Google Compute Engine.

Following is the error we are getting in Angular App:

------------------------------------------------------------------------------------------------------------------------------
WebSocket connection to 'wss://api.accenflairapps.com/agent?accountID=d6d1ac20-215a-11ea-9a84-b59bbd3171f3' failed: Error during WebSocket handshake: Unexpected response code: 404

------------------------------------------------------------------------------------------------------------------------------

Our current setup model is:

* Deployed Angular Website and Nodejs server to Google Cloud Compute Engine
*  Serving Angular App and Nodejs servers (API) through sub-domains
* Angular website & Nodejs  API serving through nginx
* Nodejs (Express + Typescript based) running in docker on port 3000 and configured reverse proxy on 443 to route traffic to internal port 3000
* 443 and 80 ports are opened
* installed LetsEncrypt  wildcard certs for both Angular website and Nodejs API

It appears the current deployment model is not perfect which is causing an issue to establish websocket connection. 

Please share your inputs to sort out this issue.

Thanks,
Anand
Reply all
Reply to author
Forward
0 new messages