Skip to content

Commit

Permalink
Show none for empty SNI
Browse files Browse the repository at this point in the history
  • Loading branch information
lilendian0x00 committed Sep 19, 2023
1 parent a98b02f commit 99130d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
26 changes: 15 additions & 11 deletions xray/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = ""
}

Expand Down
6 changes: 5 additions & 1 deletion xray/vmess.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 99130d5

Please sign in to comment.