fix: IP address is empty in unix socket mode (#1314)

pull/1324/head
WeidiDeng 3 years ago committed by GitHub
parent 3fa1249678
commit 36b310133c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,6 +76,7 @@ func main() {
} }
} }
api.TrustedPlatform = conf.UnixConfig.ProxyHeader
util.Log().Info("开始监听 %s", conf.UnixConfig.Listen) util.Log().Info("开始监听 %s", conf.UnixConfig.Listen)
if err := api.RunUnix(conf.UnixConfig.Listen); err != nil { if err := api.RunUnix(conf.UnixConfig.Listen); err != nil {
util.Log().Error("无法监听[%s]%s", conf.UnixConfig.Listen, err) util.Log().Error("无法监听[%s]%s", conf.UnixConfig.Listen, err)

@ -36,6 +36,7 @@ type ssl struct {
type unix struct { type unix struct {
Listen string Listen string
ProxyHeader string `validate:"required_with=Listen"`
} }
// slave 作为slave存储端配置 // slave 作为slave存储端配置

@ -46,6 +46,7 @@ var SSLConfig = &ssl{
var UnixConfig = &unix{ var UnixConfig = &unix{
Listen: "", Listen: "",
ProxyHeader: "X-Forwarded-For",
} }
var OptionOverwrite = map[string]interface{}{} var OptionOverwrite = map[string]interface{}{}

Loading…
Cancel
Save