Compare commits

..

No commits in common. "c7a56b1dde45235ad51c0db42d4782d52f649e22" and "1b28b196a0dcb6adab720507f25a19b4a2dd8323" have entirely different histories.

2 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,8 @@ func RequestLog() gin.HandlerFunc {
} }
ua := c.Request.UserAgent() // UA ua := c.Request.UserAgent() // UA
log.Debugf("真实IP是: %v === clientIP是 %v", c.Request.Header.Get("X-Real-Ip"), ip)
// 重写客户端IP // 重写客户端IP
c.Request.Header.Set("X-Forwarded-For", ip) c.Request.Header.Set("X-Forwarded-For", ip)
c.Request.Header.Set("X-Real-IP", ip) c.Request.Header.Set("X-Real-IP", ip)

View File

@ -45,7 +45,7 @@ func (script) GenerateConfig() error {
Email: client.Email, Email: client.Email,
PublicKey: client.Keys.PublicKey, PublicKey: client.Keys.PublicKey,
PresharedKey: client.Keys.PresharedKey, PresharedKey: client.Keys.PresharedKey,
AllowedIPS: client.IpAllocationStr, AllowedIPS: client.AllowedIpsStr,
Endpoint: client.Endpoint, Endpoint: client.Endpoint,
CreateUser: client.CreateUser, CreateUser: client.CreateUser,
Enabled: cast.ToBool(client.Enabled), Enabled: cast.ToBool(client.Enabled),