V
V
Vladimir Grabko2016-05-17 10:20:09
go
Vladimir Grabko, 2016-05-17 10:20:09

How to use WebSocket?

Good afternoon. I know that it is necessary to make a pool of connections var clients map[string]*websocket.Conn
and then send messages to everyone in a loop like this

for _, v := range clients {
    websocket.JSON.Send(v, message)
  }

But explain to me how, when connecting, a client can send his login to be added to the pool. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2016-05-17
@lucifer-m

https://github.com/onrik/wshub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question