proxyDial establishes a TCP connection to the specified address and performs an HTTP CONNECT handshake.
(ctx context.Context, addr resolver.Address, grpcUA string, opts proxyattributes.Options)
| 100 | |
| 101 | // proxyDial establishes a TCP connection to the specified address and performs an HTTP CONNECT handshake. |
| 102 | func proxyDial(ctx context.Context, addr resolver.Address, grpcUA string, opts proxyattributes.Options) (net.Conn, error) { |
| 103 | conn, err := internal.NetDialerWithTCPKeepalive().DialContext(ctx, "tcp", addr.Addr) |
| 104 | if err != nil { |
| 105 | return nil, err |
| 106 | } |
| 107 | return doHTTPConnectHandshake(ctx, conn, grpcUA, opts) |
| 108 | } |
| 109 | |
| 110 | func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error { |
| 111 | req = req.WithContext(ctx) |