title: How to create a health check for websocket in Google cloud?
body: <p>I am trying to set up a load balancer in GCP for my application over websoket. When creating a health check to determine which instances are up and working, the only header I can modify for a <code>HTTP</code> health check is the host. So I can not add the <code>Upgrade</code> header and other websocket related headers (like in <a href="https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0" rel="nofollow noreferrer">here</a>) needed to establish a connection.</p>
  <p>The documents <a href="https://cloud.google.com/load-balancing/docs/https#websocket_support" rel="nofollow noreferrer">mentions</a> that websockets are supported by default, but does not mention how health check rule should be defined. What is the best practice for using GCP load balancer with websockets? Is there a way to work around this on my end e.g. by defining an endpoint that automatically upgrades to websocket or any other methods?</p>