fix: inner request error

This commit is contained in:
Skyxim
2022-04-28 09:24:40 +08:00
parent 573be855f7
commit c161d5e6be
2 changed files with 2 additions and 12 deletions

View File

@ -33,15 +33,10 @@ func NewInner(conn net.Conn, dst string, host string) *context.ConnContext {
metadata.Host = host
metadata.AddrType = C.AtypDomainName
metadata.Process = C.ClashName
if ip, port, err := parseAddr(dst); err == nil {
if h, port, err := net.SplitHostPort(dst); err == nil {
metadata.DstPort = port
if host == "" {
metadata.DstIP = ip
if ip.Is4() {
metadata.AddrType = C.AtypIPv6
} else {
metadata.AddrType = C.AtypIPv4
}
metadata.Host = h
}
}