MCPcopy
hub / github.com/XTLS/REALITY / DialContext

Method DialContext

tls.go:690–697  ·  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

688//
689// The returned [Conn], if any, will always be of type *[Conn].
690func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
691 c, err := dial(ctx, d.netDialer(), network, addr, d.Config)
692 if err != nil {
693 // Don't return c (a typed nil) in an interface.
694 return nil, err
695 }
696 return c, nil
697}
698
699// LoadX509KeyPair reads and parses a public/private key pair from a pair of
700// files. The files must contain PEM encoded data. The certificate file may

Callers 3

DialMethod · 0.95
ServerFunction · 0.80
dialFunction · 0.80

Calls 2

netDialerMethod · 0.95
dialFunction · 0.85

Tested by

no test coverage detected