Allow Websocket connections on Google Cloud Platform

We have a GCE project, with several servers behind a loadbalancer. The servers are running a NodeJS HTTPS server. We have recently tried to implement websocket support, but can’t seem to connect to it from behind the loadbalancer. As soon as the upgrade header gets sent to the server to initiate the websocket, it closes the connection with a 400 error.

In the loadbalancer’s logs we see the following:

  @type:  ""   
  statusDetails:  "upgrade_header_rejected"   

The connection doesn’t seem to go through to our backend servers. Does anyone know how to solve this?

Server Fault Asked by Nils Eijk on January 2, 2021

1 Answers

One Answer

WebSocket is natively supported by the HTTP(s) load balancers in GCP. If you are using that load balancer and you are receiving the “upgrade_header_rejected” message is probably because the backend rejected the connection. It is also possible that the client tried to upgrade from a secure connection to an insecure one or that the header is an invalid one.

Answered by Marco on January 2, 2021

Add your own answers!

Related Questions

X-Forwarded-Proto with multiple proxies

1  Asked on January 30, 2021 by gm777


Is it possible to disable msiexec help GUI?

4  Asked on January 28, 2021 by snoweagle


Dynamic DNS registration for VPN clients

1  Asked on January 27, 2021 by eric-falsken


Sonicwall route setup

0  Asked on January 27, 2021 by dorsiwt


Ask a Question

Get help from others!

© 2022 All rights reserved.