Skip to content

Commit

Permalink
Fixed removing / at the first of ServiceName for GRPC configs
Browse files Browse the repository at this point in the history
  • Loading branch information
lilendian0x00 committed Sep 25, 2023
1 parent 10f3cc5 commit 75e166e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions xray/trojan.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ func (t *Trojan) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDe
}
break
case "grpc":
if len(t.ServiceName) > 0 {
if t.ServiceName[0] == '/' {
t.ServiceName = t.ServiceName[1:]
}
}
multiMode := false
if t.Mode != "gun" {
multiMode = true
Expand Down
11 changes: 10 additions & 1 deletion xray/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,18 @@ func (v *Vless) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDet
s.HTTPSettings.Host = &h
}
case "grpc":
if len(v.ServiceName) > 0 {
if v.ServiceName[0] == '/' {
v.ServiceName = v.ServiceName[1:]
}
}
multiMode := false
if v.Type != "gun" {
multiMode = true
}
s.GRPCConfig = &conf.GRPCConfig{
ServiceName: v.ServiceName,
MultiMode: false,
MultiMode: multiMode,
IdleTimeout: 60,
HealthCheckTimeout: 20,
PermitWithoutStream: false,
Expand Down

0 comments on commit 75e166e

Please sign in to comment.