mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add UseProxy config.
This commit is contained in:
parent
b5b86262d6
commit
15f9d71127
@ -4,4 +4,5 @@ runmode = dev
|
||||
SessionOn = true
|
||||
copyrequestbody = true
|
||||
dataSourceName = root:123@tcp(localhost:3306)/
|
||||
AuthState = "casdoor"
|
||||
AuthState = "casdoor"
|
||||
UseProxy = false
|
@ -17,14 +17,18 @@ package controllers
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
var httpClient *http.Client
|
||||
var UseOAuthProxy = true
|
||||
|
||||
func InitHttpClient() {
|
||||
if !UseOAuthProxy {
|
||||
useProxy, err := beego.AppConfig.Bool("UseProxy")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if !useProxy{
|
||||
httpClient = &http.Client{}
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user