mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-09 04:52:35 +02:00
fix route port udp selection and healthcheck interval
This commit is contained in:
parent
bdc086c285
commit
1a93df5886
1 changed files with 12 additions and 7 deletions
|
@ -298,16 +298,18 @@ func (r *Route) Finalize() {
|
||||||
if r.Host == cont.PublicHostname {
|
if r.Host == cont.PublicHostname {
|
||||||
if p, ok := cont.PrivatePortMapping[pp]; ok {
|
if p, ok := cont.PrivatePortMapping[pp]; ok {
|
||||||
pp = int(p.PublicPort)
|
pp = int(p.PublicPort)
|
||||||
if r.Scheme == "" && p.Type == "udp" {
|
|
||||||
r.Scheme = "udp"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// replace public port with private port if using private IP.
|
// replace public port with private port if using private IP.
|
||||||
if p, ok := cont.PublicPortMapping[pp]; ok {
|
if p, ok := cont.PublicPortMapping[pp]; ok {
|
||||||
pp = int(p.PrivatePort)
|
pp = int(p.PrivatePort)
|
||||||
if r.Scheme == "" && p.Type == "udp" {
|
}
|
||||||
|
}
|
||||||
|
if r.Scheme == "" {
|
||||||
|
for _, p := range cont.PublicPortMapping {
|
||||||
|
if p.Type == "udp" {
|
||||||
r.Scheme = "udp"
|
r.Scheme = "udp"
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -330,10 +332,13 @@ func (r *Route) Finalize() {
|
||||||
r.HealthCheck = health.DefaultHealthConfig
|
r.HealthCheck = health.DefaultHealthConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// set or keep at least default
|
|
||||||
if !r.HealthCheck.Disable {
|
if !r.HealthCheck.Disable {
|
||||||
r.HealthCheck.Interval |= common.HealthCheckIntervalDefault
|
if r.HealthCheck.Interval == 0 {
|
||||||
r.HealthCheck.Timeout |= common.HealthCheckTimeoutDefault
|
r.HealthCheck.Interval = common.HealthCheckIntervalDefault
|
||||||
|
}
|
||||||
|
if r.HealthCheck.Timeout == 0 {
|
||||||
|
r.HealthCheck.Timeout = common.HealthCheckTimeoutDefault
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if isDocker && cont.IdleTimeout != "" {
|
if isDocker && cont.IdleTimeout != "" {
|
||||||
|
|
Loading…
Add table
Reference in a new issue