mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Fix socks5Proxy config typo.
This commit is contained in:
parent
cf4e76f9dc
commit
06759041a8
@ -12,7 +12,7 @@ redisEndpoint =
|
|||||||
defaultStorageProvider =
|
defaultStorageProvider =
|
||||||
isCloudIntranet = false
|
isCloudIntranet = false
|
||||||
authState = "casdoor"
|
authState = "casdoor"
|
||||||
sock5Proxy = "127.0.0.1:10808"
|
socks5Proxy = "127.0.0.1:10808"
|
||||||
verificationCodeTimeout = 10
|
verificationCodeTimeout = 10
|
||||||
initScore = 2000
|
initScore = 2000
|
||||||
logPostOnly = true
|
logPostOnly = true
|
||||||
|
@ -16,7 +16,7 @@ data:
|
|||||||
defaultStorageProvider =
|
defaultStorageProvider =
|
||||||
isCloudIntranet = false
|
isCloudIntranet = false
|
||||||
authState = "casdoor"
|
authState = "casdoor"
|
||||||
sock5Proxy = "127.0.0.1:10808"
|
socks5Proxy = "127.0.0.1:10808"
|
||||||
verificationCodeTimeout = 10
|
verificationCodeTimeout = 10
|
||||||
initScore = 2000
|
initScore = 2000
|
||||||
logPostOnly = true
|
logPostOnly = true
|
||||||
|
@ -54,17 +54,17 @@ func isAddressOpen(address string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getProxyHttpClient() *http.Client {
|
func getProxyHttpClient() *http.Client {
|
||||||
sock5Proxy := conf.GetConfigString("sock5Proxy")
|
socks5Proxy := conf.GetConfigString("socks5Proxy")
|
||||||
if sock5Proxy == "" {
|
if socks5Proxy == "" {
|
||||||
return &http.Client{}
|
return &http.Client{}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isAddressOpen(sock5Proxy) {
|
if !isAddressOpen(socks5Proxy) {
|
||||||
return &http.Client{}
|
return &http.Client{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/33585587/creating-a-go-socks5-client
|
// https://stackoverflow.com/questions/33585587/creating-a-go-socks5-client
|
||||||
dialer, err := proxy.SOCKS5("tcp", sock5Proxy, nil, proxy.Direct)
|
dialer, err := proxy.SOCKS5("tcp", socks5Proxy, nil, proxy.Direct)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user