From 3b7ed982fb65e8b5045857d688d518a2924e5c0b Mon Sep 17 00:00:00 2001 From: RPRX <63339210+rprx@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:01:57 +0000 Subject: [PATCH] Add grpcSettings (alias of gunSettings) --- infra/conf/transport.go | 4 ++++ infra/conf/transport_internet.go | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/infra/conf/transport.go b/infra/conf/transport.go index 321890a77..ffff9a5c2 100644 --- a/infra/conf/transport.go +++ b/infra/conf/transport.go @@ -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 { diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index 85baa9614..80e18b58f 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -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)