mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
Add UseProxy config.
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user