mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Fix: vmess h2 use server as host if host option is empty
This commit is contained in:
parent
586bb91c0c
commit
93a8acecce
|
@ -270,7 +270,12 @@ func NewVmess(option VmessOption) (*Vmess, error) {
|
|||
option: &option,
|
||||
}
|
||||
|
||||
if option.Network == "grpc" {
|
||||
switch option.Network {
|
||||
case "h2":
|
||||
if len(option.HTTP2Opts.Host) == 0 {
|
||||
option.HTTP2Opts.Host = append(option.HTTP2Opts.Host, option.Server)
|
||||
}
|
||||
case "grpc":
|
||||
dialFn := func(network, addr string) (net.Conn, error) {
|
||||
c, err := dialer.DialContext(context.Background(), "tcp", v.addr)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user