mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Add h2 & gRPC health check
This commit is contained in:
@ -7,10 +7,23 @@ import (
|
||||
)
|
||||
|
||||
type GRPCConfig struct {
|
||||
ServiceName string `json:"serviceName"`
|
||||
MultiMode bool `json:"multiMode"`
|
||||
ServiceName string `json:"serviceName" `
|
||||
MultiMode bool `json:"multiMode"`
|
||||
IdleTimeout int32 `json:"idle_timeout"`
|
||||
HealthCheckTimeout int32 `json:"health_check_timeout"`
|
||||
}
|
||||
|
||||
func (g GRPCConfig) Build() (proto.Message, error) {
|
||||
return &grpc.Config{ServiceName: g.ServiceName, MultiMode: g.MultiMode}, nil
|
||||
func (g *GRPCConfig) Build() (proto.Message, error) {
|
||||
if g.IdleTimeout <= 0 {
|
||||
g.IdleTimeout = 0
|
||||
}
|
||||
if g.HealthCheckTimeout <= 0 {
|
||||
g.HealthCheckTimeout = 0
|
||||
}
|
||||
return &grpc.Config{
|
||||
ServiceName: g.ServiceName,
|
||||
MultiMode: g.MultiMode,
|
||||
IdleTimeout: g.IdleTimeout,
|
||||
HealthCheckTimeout: g.HealthCheckTimeout,
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user