Z
Z
zhivulinal2020-06-14 16:35:00
go
zhivulinal, 2020-06-14 16:35:00

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

2 answer(s)
A
Alexey Maslov, 2020-06-14
@zhivulinal

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.

W
WinPooh32, 2020-06-15
@WinPooh32

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 question

Ask a Question

731 491 924 answers to any question