client

package
v1.135.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, url string, requestHeader http.Header) (*websocket.Conn, *http.Response, error)

Dial opens a WebSocket connection with NewDialer. A wss:// URL to a server that requires a client certificate works only when the "http-client" configuration carries one; the error otherwise is the server's bad-certificate alert, and the server's log names the reason.

func NewDialer

func NewDialer() *websocket.Dialer

NewDialer is websocket.DefaultDialer plus the process's outbound TLS settings: the same client certificate and trust source every HTTP client in the process uses, from the "http-client" configuration. With no such configuration TLSClientConfig is nil and the dialer is DefaultDialer in all but name, so a wss:// dial verifies against the system roots as it always did and a ws:// dial is unaffected either way.

gorilla does its own handshake on the TCP connection and never offers ALPN, so a server that has HTTP/2 enabled -- as this library's does -- still sees an HTTP/1.1 upgrade from this dialer.

Types

type DXWSClient

type DXWSClient struct {
	NameId string
}

type DXWSClientManager

type DXWSClientManager struct {
	Context           context.Context
	Cancel            context.CancelFunc
	WSClient          map[string]*DXWSClient
	ErrorGroup        *errgroup.Group
	ErrorGroupContext context.Context
}
var Manager DXWSClientManager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL