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
log.Debugf("真实IP是: %v === clientIP是 %v", c.Request.Header.Get("X-Real-Ip"), ip)
// 重写客户端IP
c.Request.Header.Set("X-Forwarded-For", ip)
c.Request.Header.Set("X-Real-IP", ip)

View File

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