Browse Source

Push before leaving lab

Toby Chui 8 months ago
parent
commit
bd5aa25dfb
2 changed files with 4 additions and 6 deletions
  1. 4 5
      mod/dynamicproxy/loadbalance/loadbalance.go
  2. 0 1
      web/components/httprp.html

+ 4 - 5
mod/dynamicproxy/loadbalance/loadbalance.go

@@ -3,7 +3,6 @@ package loadbalance
 import (
 	"strings"
 	"sync"
-	"sync/atomic"
 
 	"github.com/google/uuid"
 	"github.com/gorilla/sessions"
@@ -43,10 +42,10 @@ type Upstream struct {
 
 	//Load balancing configs
 	Weight  int //Random weight for round robin, 0 for fallback only
-	MaxConn int //Maxmium connection to this server, 0 for unlimited
+	MaxConn int //TODO: Maxmium connection to this server, 0 for unlimited
 
-	currentConnectionCounts atomic.Uint64 //Counter for number of client currently connected
-	proxy                   *dpcore.ReverseProxy
+	//currentConnectionCounts atomic.Uint64 //Counter for number of client currently connected
+	proxy *dpcore.ReverseProxy
 }
 
 // Create a new load balancer
@@ -57,7 +56,7 @@ func NewLoadBalancer(options *Options) *RouteManager {
 	}
 
 	//Generate a session store for stickySession
-	store := sessions.NewCookieStore([]byte("something-very-secret"))
+	store := sessions.NewCookieStore([]byte(options.SystemUUID))
 	return &RouteManager{
 		SessionStore:           store,
 		LoadBalanceMap:         sync.Map{},

+ 0 - 1
web/components/httprp.html

@@ -234,7 +234,6 @@
         var payload = $(row).attr("payload");
         payload = JSON.parse(decodeURIComponent(payload));
         console.log(payload);
-        //console.log(payload);
         columns.each(function(index) {
             var column = $(this);
             var oldValue = column.text().trim();