mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
update dependencies
This commit is contained in:
11
vendor/golang.org/x/net/websocket/dial.go
generated
vendored
11
vendor/golang.org/x/net/websocket/dial.go
generated
vendored
@ -5,18 +5,23 @@
|
||||
package websocket
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"net"
|
||||
)
|
||||
|
||||
func dialWithDialer(dialer *net.Dialer, config *Config) (conn net.Conn, err error) {
|
||||
func dialWithDialer(ctx context.Context, dialer *net.Dialer, config *Config) (conn net.Conn, err error) {
|
||||
switch config.Location.Scheme {
|
||||
case "ws":
|
||||
conn, err = dialer.Dial("tcp", parseAuthority(config.Location))
|
||||
conn, err = dialer.DialContext(ctx, "tcp", parseAuthority(config.Location))
|
||||
|
||||
case "wss":
|
||||
conn, err = tls.DialWithDialer(dialer, "tcp", parseAuthority(config.Location), config.TlsConfig)
|
||||
tlsDialer := &tls.Dialer{
|
||||
NetDialer: dialer,
|
||||
Config: config.TlsConfig,
|
||||
}
|
||||
|
||||
conn, err = tlsDialer.DialContext(ctx, "tcp", parseAuthority(config.Location))
|
||||
default:
|
||||
err = ErrBadScheme
|
||||
}
|
||||
|
Reference in New Issue
Block a user