Change: use uint16 for Metadata SrcPort and DstPort

This commit is contained in:
Dreamacro
2023-08-03 23:20:40 +08:00
parent 47b6eb1700
commit c0e51f8556
13 changed files with 63 additions and 58 deletions

View File

@ -7,6 +7,7 @@ import (
"net"
"net/http"
"net/url"
"strconv"
"time"
"github.com/Dreamacro/clash/common/queue"
@ -194,10 +195,12 @@ func urlToMetadata(rawURL string) (addr C.Metadata, err error) {
}
}
p, _ := strconv.ParseUint(port, 10, 16)
addr = C.Metadata{
Host: u.Hostname(),
DstIP: nil,
DstPort: port,
DstPort: C.Port(p),
}
return
}