1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

Add grpcSettings (alias of gunSettings)

This commit is contained in:
RPRX 2021-03-11 16:01:57 +00:00 committed by GitHub
parent 971eddaa12
commit 3b7ed982fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,7 @@ type TransportConfig struct {
DSConfig *DomainSocketConfig `json:"dsSettings"`
QUICConfig *QUICConfig `json:"quicSettings"`
GunConfig *GunConfig `json:"gunSettings"`
GRPCConfig *GunConfig `json:"grpcSettings"`
}
// Build implements Buildable.
@ -86,6 +87,9 @@ func (c *TransportConfig) Build() (*transport.Config, error) {
})
}
if c.GunConfig == nil {
c.GunConfig = c.GRPCConfig
}
if c.GunConfig != nil {
gs, err := c.GunConfig.Build()
if err != nil {

View File

@ -336,9 +336,7 @@ func (p TransportProtocol) Build() (string, error) {
return "domainsocket", nil
case "quic":
return "quic", nil
case "gun":
return "gun", nil
case "grpc": // gun alias
case "gun", "grpc":
return "gun", nil
default:
return "", newError("Config: unknown transport protocol: ", p)