I am trying to get websockets working on google cloud endpoints but am getting a 400 response. My setup is as follows:
User => Cloud endpoints => Target instance on cloud run.
We have an openapi2 description that describes where all target instances are, it is here I think the problem lies, since calling the target instance directly works fine.
/socket.io:
get:
operationId: Websocket_passthrough_get
summary: Allows client to establish a websocket connection.
x-google-backend:
address: 'https://adress-to-server
path_translation: APPEND_PATH_TO_ADDRESS
disable_auth: true
responses:
'101':
description: Switching Protocols
'200':
description: Ok
I have tried adding a path with info on where to send the websocket requests, but I can see in the logs that it hits the proxy with "wss" but at the final destination it has changed to "https" and gets 400.
When I did this with nginx, I had to add headers for "upgrading" the connection, and it feels like there is a similar magical configuration I can make here as well.
Has anyone got this working and in that case: how?
question from:
https://stackoverflow.com/questions/66058718/websockets-on-google-cloud-endpoints 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…