fix: restore return_port field — needed for WAF→Zoraxy return routing
This commit is contained in:
parent
f40971b5bb
commit
f285295664
2 changed files with 5 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ import (
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
WAFURL string `json:"waf_url"`
|
WAFURL string `json:"waf_url"`
|
||||||
|
ReturnPort int `json:"return_port"`
|
||||||
HealthInterval int `json:"health_interval"`
|
HealthInterval int `json:"health_interval"`
|
||||||
TimeoutMs int `json:"timeout_ms"`
|
TimeoutMs int `json:"timeout_ms"`
|
||||||
}
|
}
|
||||||
|
|
@ -32,6 +33,7 @@ func defaultConfig() Config {
|
||||||
return Config{
|
return Config{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
WAFURL: "http://127.0.0.1:8080",
|
WAFURL: "http://127.0.0.1:8080",
|
||||||
|
ReturnPort: 8081,
|
||||||
HealthInterval: 5,
|
HealthInterval: 5,
|
||||||
TimeoutMs: 500,
|
TimeoutMs: 500,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
main.go
3
main.go
|
|
@ -77,6 +77,9 @@ func handleSaveConfig(w http.ResponseWriter, r *http.Request) {
|
||||||
if u := r.FormValue("waf_url"); u != "" {
|
if u := r.FormValue("waf_url"); u != "" {
|
||||||
cfg.WAFURL = u
|
cfg.WAFURL = u
|
||||||
}
|
}
|
||||||
|
if v := r.FormValue("return_port"); v != "" {
|
||||||
|
fmt.Sscanf(v, "%d", &cfg.ReturnPort)
|
||||||
|
}
|
||||||
if v := r.FormValue("health_interval"); v != "" {
|
if v := r.FormValue("health_interval"); v != "" {
|
||||||
fmt.Sscanf(v, "%d", &cfg.HealthInterval)
|
fmt.Sscanf(v, "%d", &cfg.HealthInterval)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue