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:
@@ -14,6 +14,8 @@ import (
|
||||
"github.com/Dreamacro/go-shadowsocks2/core"
|
||||
)
|
||||
|
||||
var _ Proxy = (*ShadowSocks)(nil)
|
||||
|
||||
type ShadowSocks struct {
|
||||
*Base
|
||||
|
||||
@@ -37,6 +39,10 @@ func NewShadowSocks(addr, method, password, obfsMode, obfsHost string) (*ShadowS
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (ss *ShadowSocks) Type() string {
|
||||
return "ss"
|
||||
}
|
||||
|
||||
func (ss *ShadowSocks) 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