Fix: dial IPv6 host (#29)

This commit is contained in:
beyondkmp
2018-11-04 21:12:16 +08:00
committed by Dreamacro
parent fd63707399
commit 10e0231bc1
3 changed files with 5 additions and 4 deletions

View File

@ -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,