0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-12 03:19:36 +03:00

gRPC: add keepalive option PermitWithoutStream

This commit is contained in:
hmol233
2021-07-05 21:25:21 +08:00
parent 57b9006d26
commit 31c7141fef
4 changed files with 37 additions and 21 deletions

View File

@ -7,10 +7,11 @@ import (
)
type GRPCConfig struct {
ServiceName string `json:"serviceName" `
MultiMode bool `json:"multiMode"`
IdleTimeout int32 `json:"idle_timeout"`
HealthCheckTimeout int32 `json:"health_check_timeout"`
ServiceName string `json:"serviceName" `
MultiMode bool `json:"multiMode"`
IdleTimeout int32 `json:"idle_timeout"`
HealthCheckTimeout int32 `json:"health_check_timeout"`
PermitWithoutStream bool `json:"permit_without_stream"`
}
func (g *GRPCConfig) Build() (proto.Message, error) {
@ -21,9 +22,10 @@ func (g *GRPCConfig) Build() (proto.Message, error) {
g.HealthCheckTimeout = 0
}
return &grpc.Config{
ServiceName: g.ServiceName,
MultiMode: g.MultiMode,
IdleTimeout: g.IdleTimeout,
HealthCheckTimeout: g.HealthCheckTimeout,
ServiceName: g.ServiceName,
MultiMode: g.MultiMode,
IdleTimeout: g.IdleTimeout,
HealthCheckTimeout: g.HealthCheckTimeout,
PermitWithoutStream: g.PermitWithoutStream,
}, nil
}