MCPcopy Create free account
hub / github.com/XTLS/Go / DialContext

Method DialContext

tls.go:216–223  ·  view source on GitHub ↗

DialContext connects to the given network address and initiates a TLS handshake, returning the resulting TLS connection. The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context w

(ctx context.Context, network, addr string)

Source from the content-addressed store, hash-verified

214//
215// The returned Conn, if any, will always be of type *Conn.
216func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
217 c, err := dial(ctx, d.netDialer(), network, addr, d.Config)
218 if err != nil {
219 // Don't return c (a typed nil) in an interface.
220 return nil, err
221 }
222 return c, nil
223}
224
225// LoadX509KeyPair reads and parses a public/private key pair from a pair
226// of files. The files must contain PEM encoded data. The certificate file

Callers 2

DialMethod · 0.95
dialFunction · 0.80

Calls 2

netDialerMethod · 0.95
dialFunction · 0.85

Tested by

no test coverage detected