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 ¶
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