Compare commits

...

2 commits
dev ... v0.1.3

Author SHA1 Message Date
世界
796240ec97
Update dependencies 2023-01-08 16:20:36 +08:00
世界
05a10d9bb5
Fix ParseSocksaddr 2023-01-08 16:19:41 +08:00
3 changed files with 4 additions and 8 deletions

View file

@ -4,7 +4,6 @@ import (
"net"
"net/netip"
"strconv"
"strings"
"unsafe"
"github.com/sagernet/sing/common/debug"
@ -184,12 +183,9 @@ func ParseAddr(s string) netip.Addr {
}
func ParseSocksaddr(address string) Socksaddr {
if !strings.Contains(address, ":") {
return ParseSocksaddrHostPort(address, 0)
}
host, port, err := net.SplitHostPort(address)
if err != nil {
return Socksaddr{}
return ParseSocksaddrHostPort(address, 0)
}
return ParseSocksaddrHostPortStr(host, port)
}

2
go.mod
View file

@ -2,4 +2,4 @@ module github.com/sagernet/sing
go 1.18
require golang.org/x/sys v0.3.0
require golang.org/x/sys v0.4.0

4
go.sum
View file

@ -1,2 +1,2 @@
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=