Home > Backend Development > Golang > Does Golang Support WebSockets on Managed VMs?

Does Golang Support WebSockets on Managed VMs?

Barbara Streisand
Release: 2024-11-22 01:30:13
Original
171 people have browsed it

Does Golang Support WebSockets on Managed VMs?

Golang WebSocket Support in Managed VM

Question:

Despite attempting to implement WebSockets in a Golang application running on a Managed VM, a persistent error message appears in the Chrome developer console:

WebSocket connection to 'ws://127.0.0.1:8080/connect' failed: Error during WebSocket handshake: Unexpected response code: 400
Copy after login

Additionally, the console on the backend displays the following message:

websocket: connection header != upgrade.
Copy after login

Is WebSocket support available for Golang applications hosted on Managed VMs? If so, please provide an example code snippet demonstrating its implementation.

Answer:

According to Google's documentation and the accompanying example, Managed VMs currently only support WebSockets for Java applications. This feature may be incorporated into Go in future releases, as Managed VMs are still in beta.

The above is the detailed content of Does Golang Support WebSockets on Managed VMs?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template