Skip to content

Commit

Permalink
chore: fix building
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 committed Aug 9, 2023
1 parent 6fb0acc commit 12a2db8
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, dnsCache map[string]*c
client := http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) {
cd := netproxy.ContextDialer{Dialer: direct.SymmetricDirect}
cd := netproxy.ContextDialerConverter{Dialer: direct.SymmetricDirect}
conn, err := cd.DialContext(ctx, common.MagicNetwork("tcp", conf.Global.SoMarkFromDae), addr)
if err != nil {
return nil, err
Expand Down Expand Up @@ -319,7 +319,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, dnsCache map[string]*c
client := http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) {
cd := netproxy.ContextDialer{Dialer: direct.SymmetricDirect}
cd := netproxy.ContextDialerConverter{Dialer: direct.SymmetricDirect}
conn, err := cd.DialContext(ctx, common.MagicNetwork("tcp", conf.Global.SoMarkFromDae), addr)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion common/netutils/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func resolve(ctx context.Context, d netproxy.Dialer, dns netip.AddrPort, host st
}

// Dial and write.
cd := &netproxy.ContextDialer{Dialer: d}
cd := &netproxy.ContextDialerConverter{Dialer: d}
c, err := cd.DialContext(ctx, network, dns.String())
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion component/outbound/dialer/connectivity_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func (d *Dialer) HttpCheck(ctx context.Context, u *netutils.URL, ip netip.Addr,
if method == "" {
method = http.MethodGet
}
cd := &netproxy.ContextDialer{Dialer: d.Dialer}
cd := &netproxy.ContextDialerConverter{Dialer: d.Dialer}
cli := http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) {
Expand Down
2 changes: 1 addition & 1 deletion component/outbound/dialer/trojan/trojan.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *Trojan) Dialer(option *dialer.GlobalOption, nextDialer netproxy.Dialer)
serviceName = "GunService"
}
d = &grpc.Dialer{
NextDialer: &netproxy.ContextDialer{Dialer: d},
NextDialer: &netproxy.ContextDialerConverter{Dialer: d},
ServiceName: serviceName,
ServerName: s.Sni,
AllowInsecure: s.AllowInsecure || option.AllowInsecure,
Expand Down
2 changes: 1 addition & 1 deletion component/outbound/dialer/v2ray/v2ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (s *V2Ray) Dialer(option *dialer.GlobalOption, nextDialer netproxy.Dialer)
serviceName = "GunService"
}
d = &grpc.Dialer{
NextDialer: &netproxy.ContextDialer{Dialer: d},
NextDialer: &netproxy.ContextDialerConverter{Dialer: d},
ServiceName: serviceName,
ServerName: sni,
AllowInsecure: s.AllowInsecure || option.AllowInsecure,
Expand Down
2 changes: 1 addition & 1 deletion control/dns_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func (c *DnsController) dialSend(invokingDepth int, req *udpRequest, data []byte

ctxDial, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)
defer cancel()
bestContextDialer := netproxy.ContextDialer{
bestContextDialer := netproxy.ContextDialerConverter{
Dialer: dialArgument.bestDialer,
}

Expand Down
2 changes: 1 addition & 1 deletion control/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *ControlPlane) RouteDialTcp(p *RouteDialParam) (conn netproxy.Conn, err
}
ctx, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)
defer cancel()
cd := netproxy.ContextDialer{
cd := netproxy.ContextDialerConverter{
Dialer: d,
}
return cd.DialContext(ctx, common.MagicNetwork("tcp", routingResult.Mark), dialTarget)
Expand Down
2 changes: 1 addition & 1 deletion control/udp_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ begin:
if err != nil {
return nil, false, err
}
cd := netproxy.ContextDialer{
cd := netproxy.ContextDialerConverter{
Dialer: dialOption.Dialer,
}
ctx, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)
Expand Down

0 comments on commit 12a2db8

Please sign in to comment.