Load proxy list before client connections and reload periodically

This commit is contained in:
Bilal
2020-05-22 16:00:25 +02:00
parent 491fbfd1f1
commit 5fb5d22ff2
3 changed files with 48 additions and 19 deletions

View File

@@ -44,6 +44,8 @@ func generateClientConfigObject() {
ClientConfig.WorkerServerAddress = getString("WORKER_SERVER_ADDRESS")
ClientConfig.RequestMessagePrefix = getString("REQUEST_MESSAGE_PREFIX")
ClientConfig.ProxyListBaseURL = getString("PROXY_LIST_BASE_URL")
ClientConfig.ProxyListReloadInterval = getInt("PROXY_LIST_RELOAD_INTERVAL")
ClientConfig.ProxyListTimeout = getInt("PROXY_LIST_TIMEOUT")
customSOCKS5ProxyListString := getString("CUSTOM_SOCKS5_PROXY_LIST")
customSOCKS5ProxyList := strings.Split(customSOCKS5ProxyListString, ",")
@@ -74,6 +76,8 @@ func initClientConfigDefaultValues() {
defaultClientConfigValues["REQUEST_MESSAGE_PREFIX"] = "URL "
defaultClientConfigValues["PROXY_LIST_BASE_URL"] = ""
defaultClientConfigValues["CUSTOM_SOCKS5_PROXY_LIST"] = ""
defaultClientConfigValues["PROXY_LIST_RELOAD_INTERVAL"] = "30"
defaultClientConfigValues["PROXY_LIST_TIMEOUT"] = "10"
}
func initServerConfigDefaultValues() {