Skip to content

Commit

Permalink
Fix socks5Proxy config typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Jul 8, 2022
1 parent cf4e76f commit 0675904
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ redisEndpoint =
defaultStorageProvider =
isCloudIntranet = false
authState = "casdoor"
sock5Proxy = "127.0.0.1:10808"
socks5Proxy = "127.0.0.1:10808"
verificationCodeTimeout = 10
initScore = 2000
logPostOnly = true
Expand Down
2 changes: 1 addition & 1 deletion manifests/casdoor/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data:
defaultStorageProvider =
isCloudIntranet = false
authState = "casdoor"
sock5Proxy = "127.0.0.1:10808"
socks5Proxy = "127.0.0.1:10808"
verificationCodeTimeout = 10
initScore = 2000
logPostOnly = true
Expand Down
8 changes: 4 additions & 4 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ func isAddressOpen(address string) bool {
}

func getProxyHttpClient() *http.Client {
sock5Proxy := conf.GetConfigString("sock5Proxy")
if sock5Proxy == "" {
socks5Proxy := conf.GetConfigString("socks5Proxy")
if socks5Proxy == "" {
return &http.Client{}
}

if !isAddressOpen(sock5Proxy) {
if !isAddressOpen(socks5Proxy) {
return &http.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 {
panic(err)
}
Expand Down

0 comments on commit 0675904

Please sign in to comment.