Fix: dial IPv6 host (#29)
This commit is contained in:
parent
e9dfbae5cb
commit
1cd055b9ce
3 changed files with 5 additions and 4 deletions
|
@ -72,7 +72,7 @@ func (ss *ShadowSocks) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter,
|
|||
}
|
||||
|
||||
func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error) {
|
||||
server := fmt.Sprintf("%s:%d", option.Server, option.Port)
|
||||
server := net.JoinHostPort(option.Server, strconv.Itoa(option.Port))
|
||||
cipher := option.Cipher
|
||||
password := option.Password
|
||||
ciph, err := core.PickCipher(cipher, nil, password)
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"strconv"
|
||||
|
||||
C "github.com/Dreamacro/clash/constant"
|
||||
|
||||
|
@ -114,7 +115,7 @@ func NewSocks5(option Socks5Option) *Socks5 {
|
|||
}
|
||||
|
||||
return &Socks5{
|
||||
addr: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
addr: net.JoinHostPort(option.Server, strconv.Itoa(option.Port)),
|
||||
name: option.Name,
|
||||
tls: option.TLS,
|
||||
skipCertVerify: option.SkipCertVerify,
|
||||
|
|
|
@ -68,7 +68,7 @@ func NewVmess(option VmessOption) (*Vmess, error) {
|
|||
AlterID: uint16(option.AlterID),
|
||||
Security: security,
|
||||
TLS: option.TLS,
|
||||
Host: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
Host: net.JoinHostPort(option.Server, strconv.Itoa(option.Port)),
|
||||
NetWork: option.Network,
|
||||
WebSocketPath: option.WSPath,
|
||||
SkipCertVerify: option.SkipCertVerify,
|
||||
|
@ -80,7 +80,7 @@ func NewVmess(option VmessOption) (*Vmess, error) {
|
|||
|
||||
return &Vmess{
|
||||
name: option.Name,
|
||||
server: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
server: net.JoinHostPort(option.Server, strconv.Itoa(option.Port)),
|
||||
client: client,
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue