mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-12-21 23:07:04 +01:00
Fixed #903
This commit is contained in:
@@ -39,7 +39,6 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/gorilla/csrf"
|
"github.com/gorilla/csrf"
|
||||||
@@ -128,7 +127,9 @@ func main() {
|
|||||||
ReverseProxyInit()
|
ReverseProxyInit()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
time.Sleep(500 * time.Millisecond)
|
// Wait for dynamicProxyRouter to be initialized before proceeding
|
||||||
|
// See ReverseProxyInit() in reverseproxy.go
|
||||||
|
<-dynamicProxyRouterReady
|
||||||
|
|
||||||
//Start the finalize sequences
|
//Start the finalize sequences
|
||||||
finalSequence()
|
finalSequence()
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
dynamicProxyRouter *dynamicproxy.Router
|
dynamicProxyRouter *dynamicproxy.Router
|
||||||
|
dynamicProxyRouterReady = make(chan bool, 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add user customizable reverse proxy
|
// Add user customizable reverse proxy
|
||||||
@@ -128,6 +129,12 @@ func ReverseProxyInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dynamicProxyRouter = dprouter
|
dynamicProxyRouter = dprouter
|
||||||
|
// Signal that the router is ready
|
||||||
|
select {
|
||||||
|
case dynamicProxyRouterReady <- true:
|
||||||
|
default:
|
||||||
|
// Channel already has a value, skip
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user