mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-01 01:44:15 +00:00
Add h2 & gRPC health check
This commit is contained in:
parent
d45298a10d
commit
d9d04a230f
8 changed files with 162 additions and 83 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue