Versions in this module Expand all Collapse all v2 v2.0.8 Jun 19, 2026 Changes in this version + const Namespace + var ErrNoConfig = errors.New("websocket: no config") + func AcceptOptions(cfg Config) *websocket.AcceptOptions + func BackendWSURL(endpoint *config.EndpointConfig, c *gin.Context) (string, error) + func EncodeEnvelope(env Envelope) ([]byte, error) + func ExtractHeaders(c *gin.Context, allowed []string) http.Header + func ExtractParams(c *gin.Context) map[string]string + func IsConfigured(extra config.ExtraConfig) bool + func IsWebSocketUpgrade(r *http.Request) bool + func PingLoop(ctx context.Context, conn *websocket.Conn, period, pongWait time.Duration) + func ResetHubRegistry() + func RunDirect(ctx context.Context, client *websocket.Conn, backendURL string, ...) + func SessionFromParams(params map[string]string, uuid string) map[string]interface + type ClientSession struct + func NewClientSession(id, url string, session map[string]interface{}, conn *websocket.Conn, ...) *ClientSession + type Config struct + BackoffStrategy string + ConnectEvent bool + DisableOTELMetrics bool + DisconnectEvent bool + EnableDirectCommunication bool + InputHeaders []string + MaxMessageSize int64 + MaxRetries int + MessageBufferSize int + PingPeriod time.Duration + PongWait time.Duration + ReadBufferSize int + ReturnErrorDetails bool + Subprotocols []string + Timeout time.Duration + WriteBufferSize int + WriteWait time.Duration + func Parse(extra config.ExtraConfig) (Config, error) + type Envelope struct + Body string + Session map[string]interface{} + URL string + func DecodeEnvelope(data []byte) (Envelope, error) + func NewOutboundEnvelope(url string, session map[string]interface{}, payload []byte) Envelope + func (e *Envelope) Payload() ([]byte, error) + type Hub struct + func GetHub(endpoint string, cfg Config, logger logging.Logger) *Hub + func (h *Hub) EnsureBackend(ctx context.Context, url string, headers http.Header) error + func (h *Hub) HandleClient(ctx context.Context, s *ClientSession, endpointURL string) + func (h *Hub) RegisterClient(s *ClientSession) + type Metrics struct + func GetMetrics(disabled bool) *Metrics + func (m *Metrics) ConnectionClosed(ctx context.Context, endpoint string) + func (m *Metrics) ConnectionOpened(ctx context.Context, endpoint string)