feat: 连接列表显示客户端真实 IP,支持反代和 CDN 场景

新增可配置的 real_ip_headers(默认 CF-Connecting-IP > X-Real-IP >
X-Forwarded-For 降级取值),trusted_proxies 用于 gin 代理信任链。
WebSocket 连接建立时捕获真实 IP 并在 /profile 和 /admin 连接列表展示,
登录会话 IP 同步改用真实 IP。
This commit is contained in:
2026-07-10 16:58:14 +08:00
parent a98cdb0cac
commit 8398067acb
13 changed files with 67 additions and 13 deletions
+1
View File
@@ -435,6 +435,7 @@ type ClientInfo struct {
Username string `json:"username"`
IP string `json:"ip"`
IP6 string `json:"ip6,omitempty"`
RealIP string `json:"real_ip"`
ConnectedAt string `json:"connected_at"`
RxBytes int64 `json:"rx_bytes"`
TxBytes int64 `json:"tx_bytes"`