-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Lines 160 to 180 in 04d1587
| func (l *wsListener) upgrade(w http.ResponseWriter, r *http.Request) { | |
| if l.logger.IsLevelEnabled(logger.TraceLevel) { | |
| log := l.logger.WithFields(map[string]any{ | |
| "local": l.addr.String(), | |
| "remote": r.RemoteAddr, | |
| }) | |
| dump, _ := httputil.DumpRequest(r, false) | |
| log.Trace(string(dump)) | |
| } | |
| conn, err := l.upgrader.Upgrade(w, r, l.md.header) | |
| if err != nil { | |
| l.logger.Error(err) | |
| w.WriteHeader(http.StatusInternalServerError) | |
| return | |
| } | |
| var clientAddr net.Addr | |
| if clientIP := xhttp.GetClientIP(r); clientIP != nil { | |
| clientAddr = &net.IPAddr{IP: clientIP} | |
| } |
现状:
日志中的 remote 都是 127.0.0.x
期望:
日志中的 remote 是真实客户端 IP
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels