add router interface

This commit is contained in:
ginuerzh
2024-07-08 22:28:21 +08:00
parent 30cc928705
commit 48d070d345
20 changed files with 37 additions and 1112 deletions

View File

@ -4,7 +4,7 @@ import (
"crypto/tls"
"net/url"
"github.com/go-gost/core/common/net/dialer"
xnet "github.com/go-gost/core/common/net"
"github.com/go-gost/core/logger"
)
@ -42,8 +42,8 @@ func ProxyProtocolOption(ppv int) Option {
}
type DialOptions struct {
Host string
NetDialer *dialer.NetDialer
Host string
Dialer xnet.Dialer
}
type DialOption func(opts *DialOptions)
@ -54,9 +54,9 @@ func HostDialOption(host string) DialOption {
}
}
func NetDialerDialOption(netd *dialer.NetDialer) DialOption {
func NetDialerDialOption(dialer xnet.Dialer) DialOption {
return func(opts *DialOptions) {
opts.NetDialer = netd
opts.Dialer = dialer
}
}