diff --git a/xray/trojan.go b/xray/trojan.go index 7ce339e..6db185a 100644 --- a/xray/trojan.go +++ b/xray/trojan.go @@ -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 diff --git a/xray/vless.go b/xray/vless.go index 408be25..bc5c682 100644 --- a/xray/vless.go +++ b/xray/vless.go @@ -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,