mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 04:47:40 +03:00
Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
|
796240ec97 | ||
|
05a10d9bb5 |
3 changed files with 4 additions and 8 deletions
|
@ -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
2
go.mod
|
@ -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
4
go.sum
|
@ -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=
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue