Thursday, June 22, 2017

GCP HTTP Load balancer - Websocket getting upgrade but no frames from the client

Leave a Comment

I just noticed that gcp http(s) load balancer now supports websockets. I went to try it out and am having some problems. I have a gloabl https load balancer setup with Cloud CDN and a simple, no url-map, backend (Node.js). When I go to make websocket connection, I get a successful upgrade response but when I go to send frames to the server, they are never received. The server can send frames back to the client just fine. It is almost like the load balancer doesn't know that the connection has been upgraded and therefore doesn't allow any data sent from the client.

When I look in the logs for the https load balancer, I see the 101 Switching Protocols response and then statusDetails is "client_disconnected_after_partial_response" almost like it was a normal http request.

Any help would be appreciated.

1 Answers

Answers 1

After some investigation it seems that when a GCP load balancer is going through the GCP CDN, client messages never make it to the backend.

I worked around this by duplicating the backend configuration I wanted in a new backend called "websocket-prototype," and then just changing the "use cdn" setting for the websocket prototype. Finally, I mapped the path to my websocket server to the configuration without the CDN.

enter image description here

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment