mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-14 20:39:36 +03:00
Add h2 & gRPC health check
This commit is contained in:
@ -179,14 +179,24 @@ func (c *WebSocketConfig) Build() (proto.Message, error) {
|
||||
}
|
||||
|
||||
type HTTPConfig struct {
|
||||
Host *StringList `json:"host"`
|
||||
Path string `json:"path"`
|
||||
Host *StringList `json:"host"`
|
||||
Path string `json:"path"`
|
||||
ReadIdleTimeout int32 `json:"read_idle_timeout"`
|
||||
HealthCheckTimeout int32 `json:"health_check_timeout"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
func (c *HTTPConfig) Build() (proto.Message, error) {
|
||||
if c.ReadIdleTimeout <= 0 {
|
||||
c.ReadIdleTimeout = 0
|
||||
}
|
||||
if c.HealthCheckTimeout <= 0 {
|
||||
c.HealthCheckTimeout = 0
|
||||
}
|
||||
config := &http.Config{
|
||||
Path: c.Path,
|
||||
Path: c.Path,
|
||||
IdleTimeout: c.ReadIdleTimeout,
|
||||
HealthCheckTimeout: c.HealthCheckTimeout,
|
||||
}
|
||||
if c.Host != nil {
|
||||
config.Host = []string(*c.Host)
|
||||
|
Reference in New Issue
Block a user