Added load balance origin picker

+ Added load balance picker
+ Added fallback mode for upstream
+ Added stick session
This commit is contained in:
Toby Chui
2024-07-12 20:14:31 +08:00
parent 2aa35cbe6d
commit aca6e44b35
12 changed files with 266 additions and 109 deletions

View File

@@ -207,12 +207,7 @@ func ReverseProxyHandleAddEndpoint(w http.ResponseWriter, r *http.Request) {
useBypassGlobalTLS := bypassGlobalTLS == "true"
//Enable TLS validation?
stv, _ := utils.PostPara(r, "tlsval")
if stv == "" {
stv = "false"
}
skipTlsValidation := (stv == "true")
skipTlsValidation, _ := utils.PostBool(r, "tlsval")
//Get access rule ID
accessRuleID, _ := utils.PostPara(r, "access")
@@ -225,12 +220,10 @@ func ReverseProxyHandleAddEndpoint(w http.ResponseWriter, r *http.Request) {
}
// Require basic auth?
rba, _ := utils.PostPara(r, "bauth")
if rba == "" {
rba = "false"
}
requireBasicAuth, _ := utils.PostBool(r, "bauth")
requireBasicAuth := (rba == "true")
//Use sticky session?
useStickySession, _ := utils.PostBool(r, "stickysess")
// Require Rate Limiting?
requireRateLimit := false
@@ -328,7 +321,7 @@ func ReverseProxyHandleAddEndpoint(w http.ResponseWriter, r *http.Request) {
},
},
InactiveOrigins: []*loadbalance.Upstream{},
UseStickySession: false, //TODO: Move options to webform
UseStickySession: useStickySession,
//TLS
BypassGlobalTLS: useBypassGlobalTLS,