From 60a30a1f20635e9002095723f2759ed015289237 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Sat, 3 Nov 2018 12:28:34 +0800 Subject: [PATCH] add auth info for http log (#286) --- http.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/http.go b/http.go index a1923db..5287232 100644 --- a/http.go +++ b/http.go @@ -239,9 +239,14 @@ func (h *httpHandler) handleRequest(conn net.Conn, req *http.Request) { } } - log.Logf("[http] %s <-> %s", cc.LocalAddr(), host) + var su string + if u != "" { + su = u + "@" + } + + log.Logf("[http] %s%s <-> %s", su, cc.LocalAddr(), host) transport(conn, cc) - log.Logf("[http] %s >-< %s", cc.LocalAddr(), host) + log.Logf("[http] %s%s >-< %s", su, cc.LocalAddr(), host) } func (h *httpHandler) forwardRequest(conn net.Conn, req *http.Request, route *Chain) error {