Feature: trace adapters when dialing (#170)

This commit is contained in:
Yunhao Zhang
2019-08-09 01:28:37 +08:00
committed by Dreamacro
parent 5829c3d5be
commit b926f4cf09
13 changed files with 166 additions and 56 deletions

View File

@ -35,7 +35,7 @@ type HttpOption struct {
SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"`
}
func (h *Http) Dial(metadata *C.Metadata) (net.Conn, error) {
func (h *Http) Dial(metadata *C.Metadata) (C.Conn, error) {
c, err := dialTimeout("tcp", h.addr, tcpTimeout)
if err == nil && h.tls {
cc := tls.Client(c, h.tlsConfig)
@ -51,7 +51,7 @@ func (h *Http) Dial(metadata *C.Metadata) (net.Conn, error) {
return nil, err
}
return c, nil
return newConn(c, h), nil
}
func (h *Http) shakeHand(metadata *C.Metadata, rw io.ReadWriter) error {