fix grpc dialer

This commit is contained in:
ginuerzh 2022-08-19 22:26:40 +08:00
parent 4c1da3e4d4
commit 8098e9f976
3 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ func (c *http2Connector) Connect(ctx context.Context, conn net.Conn, network, ad
} }
client := v.GetMetadata().Get("client").(*http.Client) client := v.GetMetadata().Get("client").(*http.Client)
resp, err := client.Do(req.WithContext(ctx)) resp, err := client.Do(req)
if err != nil { if err != nil {
log.Error(err) log.Error(err)
conn.Close() conn.Close()

View File

@ -99,7 +99,7 @@ func (d *grpcDialer) Dial(ctx context.Context, addr string, opts ...dialer.DialO
d.clients[addr] = client d.clients[addr] = client
} }
cli, err := client.TunnelX(ctx, d.md.path) cli, err := client.TunnelX(context.Background(), d.md.path)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -37,7 +37,7 @@ func (c *conn) Close() error {
} }
func (c *conn) LocalAddr() net.Addr { func (c *conn) LocalAddr() net.Addr {
return c.raddr return c.laddr
} }
func (c *conn) RemoteAddr() net.Addr { func (c *conn) RemoteAddr() net.Addr {