mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-06 09:16:58 +08:00
Chore: add Type() method to proxy.Proxy
This commit is contained in:
@@ -12,6 +12,8 @@ import (
|
||||
"github.com/xjasonlyu/tun2socks/component/socks5"
|
||||
)
|
||||
|
||||
var _ Proxy = (*Socks5)(nil)
|
||||
|
||||
type Socks5 struct {
|
||||
*Base
|
||||
|
||||
@@ -27,6 +29,10 @@ func NewSocks5(addr, user, pass string) (*Socks5, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (ss *Socks5) Type() string {
|
||||
return "socks5"
|
||||
}
|
||||
|
||||
func (ss *Socks5) DialContext(ctx context.Context, metadata *adapter.Metadata) (c net.Conn, err error) {
|
||||
c, err = dialer.DialContext(ctx, "tcp", ss.Addr())
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user