Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultRedisTopic = "nimbus:websocket:broadcast"
DefaultRedisTopic is the Pub/Sub topic hubs use to share broadcasts.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub holds connected clients and broadcasts to them. With UseRedis, a broadcast on any instance reaches the clients of every instance.
func (*Hub) Broadcast ¶
Broadcast sends a message to all connected clients (of every instance, with UseRedis).
func (*Hub) SetAllowedOrigins ¶
SetAllowedOrigins configures allowed websocket origins. When empty, same-origin requests are allowed by default.
Click to show internal directories.
Click to hide internal directories.