I'm unable to connect to ws for a service deployed in app engine from angular

Hi I am new to app engine and I have deployed a spring boot application and it live now, I am able to access swagger and the REST API endpoints that I have created but when it comes to web socket and the root path my requests are being blocked.

In my angular which also use the rest endpoint to get data are working and the when it tries to establish a connection with websockets it doesn't work states CORS error.

I have enabled cross origin on all my controller and ws config as well. The application when deployed on render works fine but not on app engine 🤷. Can anyone help me understand.

And please also suggest if i should be using app engine or cloud run

Thanks for helping.

0 3 102
3 REPLIES 3

If this is App Engine Standard, then web sockets isn't supported (see documentation). You'll have to either use App Engine Flex or Cloud Run

 

......NoCommandLine ......
 https://nocommandline.com
A GUI for Google App Engine
    & Datastore Emulator

Hi Vardhan!
i am also new to GCP VM deployment , i have also deployed my springboot application on VM ,
it is running fine but when i try to hit the endpoint with IPv4 and port , it is getting timedout!
Not sure why this is happening, can you suggest any solution for this ?
Thanks in advance 

I had a lot of issues with websockets on google app engine.  The issue for me (Flask Server using gunicorn and Flask-Sockets) was that GAE uses a reverse proxy.  Meaning all HTTPS traffic comes in and gets converted to HTTP between the proxy and your App.  I solved that by forcing HTTPS, but the problem is that websocket requests start as HTTP and upgrade to HTTPS.  I was able to solve for my situation, but I'm not sure exactly what your code is like.  Happy to post my Flask/Flask-Sockets fix but at a higher level the issue was the reverse proxy GAE uses.