WebSocket Support in Google's Managed VMs for Golang Applications
In your query, you mentioned facing difficulties establishing WebSocket connections within your Golang application deployed on Google's Managed VM. Chrome's developer console returned error code 400, while the backend reported "websocket: connection header != upgrade."
Supporting WebSocket connections in Managed VMs
Currently, according to Google's official documentation and the provided examples, WebSocket support within Managed VMs is only available for Java-based applications. The documentation states:
"Managed VMs currently supports Java and Go runtimes. Note that this [WebSocket] functionality is available only for Java."
Future Support for Golang
Given that Managed VMs is still in beta, it is possible that WebSocket support for Golang will be added in the future. However, there is currently no information on when or if this functionality will be made available.
Therefore, at this time, Managed VMs do not fully support WebSocket connections for Golang applications. It is recommended to use alternative solutions, such as Cloud Run for deploying WebSocket applications built with Golang.
The above is the detailed content of Does Google\'s Managed VMs Support WebSockets for Golang Applications?. For more information, please follow other related articles on the PHP Chinese website!