mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-20 00:50:06 +08:00
chore: cleanup default value in parseProxy
This commit is contained in:
parent
27b47f976c
commit
421dc79aea
@ -49,13 +49,7 @@ func ParseProxy(mapping map[string]any) (C.Proxy, error) {
|
|||||||
}
|
}
|
||||||
proxy, err = outbound.NewHttp(*httpOption)
|
proxy, err = outbound.NewHttp(*httpOption)
|
||||||
case "vmess":
|
case "vmess":
|
||||||
vmessOption := &outbound.VmessOption{
|
vmessOption := &outbound.VmessOption{}
|
||||||
HTTPOpts: outbound.HTTPOptions{
|
|
||||||
Method: "GET",
|
|
||||||
Path: []string{"/"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
err = decoder.Decode(mapping, vmessOption)
|
err = decoder.Decode(mapping, vmessOption)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package vmess
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -55,11 +54,11 @@ func (hc *httpConn) Write(b []byte) (int, error) {
|
|||||||
return hc.Conn.Write(b)
|
return hc.Conn.Write(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(hc.cfg.Path) == 0 {
|
path := "/"
|
||||||
return -1, errors.New("path is empty")
|
if len(hc.cfg.Path) > 0 {
|
||||||
|
path = hc.cfg.Path[randv2.IntN(len(hc.cfg.Path))]
|
||||||
}
|
}
|
||||||
|
|
||||||
path := hc.cfg.Path[randv2.IntN(len(hc.cfg.Path))]
|
|
||||||
host := hc.cfg.Host
|
host := hc.cfg.Host
|
||||||
if header := hc.cfg.Headers["Host"]; len(header) != 0 {
|
if header := hc.cfg.Headers["Host"]; len(header) != 0 {
|
||||||
host = header[randv2.IntN(len(header))]
|
host = header[randv2.IntN(len(header))]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user