Include hostPort in function signature

This commit is contained in:
Sleeyax 2022-10-26 19:04:40 +02:00
parent adb13885c2
commit 36867e9319
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ type Dialer struct {
// ProxyTLSConnection is nil, NetDialTLSContext is used. // ProxyTLSConnection is nil, NetDialTLSContext is used.
// If ProxyTLSConnection is set, Dial assumes the TLS handshake is done there and // If ProxyTLSConnection is set, Dial assumes the TLS handshake is done there and
// TLSClientConfig is ignored. // TLSClientConfig is ignored.
ProxyTLSConnection func(ctx context.Context, proxyConn net.Conn) (net.Conn, error) ProxyTLSConnection func(ctx context.Context, hostPort string, proxyConn net.Conn) (net.Conn, error)
// Proxy specifies a function to return a proxy for a given // Proxy specifies a function to return a proxy for a given
// Request. If the function returns a non-nil error, the // Request. If the function returns a non-nil error, the
@ -342,7 +342,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
if u.Scheme == "https" { if u.Scheme == "https" {
if d.ProxyTLSConnection != nil && d.Proxy != nil { if d.ProxyTLSConnection != nil && d.Proxy != nil {
// If we are connected to a proxy, perform the TLS handshake through the existing tunnel // If we are connected to a proxy, perform the TLS handshake through the existing tunnel
netConn, err = d.ProxyTLSConnection(ctx, netConn) netConn, err = d.ProxyTLSConnection(ctx, hostPort, netConn)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }