diff --git a/conf/app.conf b/conf/app.conf index 8278244b..25eb61a1 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -12,7 +12,7 @@ redisEndpoint = defaultStorageProvider = isCloudIntranet = false authState = "casdoor" -httpProxy = "127.0.0.1:10808" +sock5Proxy = "127.0.0.1:10808" verificationCodeTimeout = 10 initScore = 2000 logPostOnly = true diff --git a/manifests/casdoor/templates/configmap.yaml b/manifests/casdoor/templates/configmap.yaml index facd0d71..337aac1d 100644 --- a/manifests/casdoor/templates/configmap.yaml +++ b/manifests/casdoor/templates/configmap.yaml @@ -16,7 +16,7 @@ data: defaultStorageProvider = isCloudIntranet = false authState = "casdoor" - httpProxy = "127.0.0.1:10808" + sock5Proxy = "127.0.0.1:10808" verificationCodeTimeout = 10 initScore = 2000 logPostOnly = true diff --git a/proxy/proxy.go b/proxy/proxy.go index aff04286..53ccf970 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -54,17 +54,17 @@ func isAddressOpen(address string) bool { } func getProxyHttpClient() *http.Client { - httpProxy := beego.AppConfig.String("httpProxy") - if httpProxy == "" { + sock5Proxy := beego.AppConfig.String("sock5Proxy") + if sock5Proxy == "" { return &http.Client{} } - if !isAddressOpen(httpProxy) { + if !isAddressOpen(sock5Proxy) { return &http.Client{} } // https://stackoverflow.com/questions/33585587/creating-a-go-socks5-client - dialer, err := proxy.SOCKS5("tcp", httpProxy, nil, proxy.Direct) + dialer, err := proxy.SOCKS5("tcp", sock5Proxy, nil, proxy.Direct) if err != nil { panic(err) }