Answer the question
In order to leave comments, you need to log in
golang+websockets. How to receive changes from other services?
I'm new to golang.
I want to use a websocket to change data on the site, for example, the amount of the balance.
The data comes from another service, and here is the problem, gRPC methods do not work in the web version of the service.
How to be in such a situation?
Yuzayu:
- go-micro
- Gqlgen
- Gorilla websocket
- Gorilla mux
Answer the question
In order to leave comments, you need to log in
There was a similar task: Instead of bicycle building, I used a ready-made tool:
centrifugo
Written in go, there are clients for all popular languages. Managed by rest api and grpc.
There is also a socket.io implementation for golang.
But for pumping skills, I would still recommend a custom implementation of asynchronous messaging over WebSocket.
Also, to receive events (only from the server to the browser, it also interacts as usual via http) there is still such a technology as Server-sent events . In conjunction with http2 generally fire.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question