From 99130d525a8d8fb263b8cc9f6b607b0007b264fc Mon Sep 17 00:00:00 2001 From: lilendian0x00 Date: Tue, 19 Sep 2023 23:21:16 +0100 Subject: [PATCH] Show none for empty SNI --- xray/vless.go | 26 +++++++++++++++----------- xray/vmess.go | 6 +++++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/xray/vless.go b/xray/vless.go index d68e20a..408be25 100644 --- a/xray/vless.go +++ b/xray/vless.go @@ -119,7 +119,11 @@ func (v *Vless) DetailsStr() string { } else if copyV.Security == "tls" { info += fmt.Sprintf("%s: tls\n", color.RedString("TLS")) if len(copyV.SNI) == 0 { - copyV.SNI = copyV.Host + if copyV.Host != "" { + copyV.SNI = copyV.Host + } else { + copyV.SNI = "none" + } } if len(copyV.ALPN) == 0 { copyV.ALPN = "none" @@ -213,18 +217,18 @@ func (v *Vless) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDet s.HTTPSettings.Host = &h } case "grpc": - multiMode := false - if v.Mode != "gun" { - multiMode = true - } s.GRPCConfig = &conf.GRPCConfig{ - InitialWindowsSize: 65536, - HealthCheckTimeout: 20, - MultiMode: multiMode, - IdleTimeout: 60, - ServiceName: v.ServiceName, + ServiceName: v.ServiceName, + MultiMode: false, + IdleTimeout: 60, + HealthCheckTimeout: 20, + PermitWithoutStream: false, + InitialWindowsSize: 65536, + UserAgent: "", + } + if v.Mode != "gun" { + s.GRPCConfig.MultiMode = true } - v.Flow = "" } diff --git a/xray/vmess.go b/xray/vmess.go index ca059d2..d34c111 100644 --- a/xray/vmess.go +++ b/xray/vmess.go @@ -151,7 +151,11 @@ func (v *Vmess) DetailsStr() string { } if len(copyV.TLS) != 0 { if len(copyV.SNI) == 0 { - copyV.SNI = copyV.Host + if copyV.Host != "" { + copyV.SNI = copyV.Host + } else { + copyV.SNI = "none" + } } if len(copyV.ALPN) == 0 { copyV.ALPN = "none"