mirror of
https://github.com/fatedier/frp.git
synced 2026-04-08 18:19:14 +08:00
frpc: add support for connecting server through http proxies, see #67
This commit is contained in:
@@ -16,6 +16,7 @@ package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -26,6 +27,7 @@ import (
|
||||
var (
|
||||
ServerAddr string = "0.0.0.0"
|
||||
ServerPort int64 = 7000
|
||||
HttpProxy string = ""
|
||||
LogFile string = "console"
|
||||
LogWay string = "console"
|
||||
LogLevel string = "info"
|
||||
@@ -57,6 +59,14 @@ func LoadConf(confFile string) (err error) {
|
||||
ServerPort, _ = strconv.ParseInt(tmpStr, 10, 64)
|
||||
}
|
||||
|
||||
tmpStr, ok = conf.Get("common", "http_proxy")
|
||||
if ok {
|
||||
HttpProxy = tmpStr
|
||||
} else {
|
||||
// get http_proxy from env
|
||||
HttpProxy = os.Getenv("http_proxy")
|
||||
}
|
||||
|
||||
tmpStr, ok = conf.Get("common", "log_file")
|
||||
if ok {
|
||||
LogFile = tmpStr
|
||||
|
||||
Reference in New Issue
Block a user