mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-11 20:48:02 +08:00
fix: url format error when host is IPv6
[Bug] 使用IPV6地址+vmess+http伪装的配置引起内核panic MetaCubeX/mihomo#1063
This commit is contained in:
parent
78b4b11f26
commit
0619c75276
@ -60,7 +60,7 @@ func (hc *httpConn) Write(b []byte) (int, error) {
|
||||
host = header[fastrand.Intn(len(header))]
|
||||
}
|
||||
|
||||
u := fmt.Sprintf("http://%s%s", host, path)
|
||||
u := fmt.Sprintf("http://%s%s", net.JoinHostPort(host, "80"), path)
|
||||
req, _ := http.NewRequest(utils.EmptyOr(hc.cfg.Method, http.MethodGet), u, bytes.NewBuffer(b))
|
||||
for key, list := range hc.cfg.Headers {
|
||||
req.Header.Set(key, list[fastrand.Intn(len(list))])
|
||||
|
Loading…
Reference in New Issue
Block a user