sing/common/network/dialer.go
2022-04-28 08:21:10 +08:00

22 lines
488 B
Go

package network
import (
"context"
"net"
M "github.com/sagernet/sing/common/metadata"
)
type ContextDialer interface {
DialContext(ctx context.Context, network string, address *M.AddrPort) (net.Conn, error)
}
var SystemDialer ContextDialer = &DefaultDialer{}
type DefaultDialer struct {
net.Dialer
}
func (d *DefaultDialer) DialContext(ctx context.Context, network string, address *M.AddrPort) (net.Conn, error) {
return d.Dialer.DialContext(ctx, network, address.String())
}