diff --git a/common/stats/session/session.go b/common/stats/session/session.go index 114e5e3..df43da4 100644 --- a/common/stats/session/session.go +++ b/common/stats/session/session.go @@ -62,6 +62,7 @@ func (s *simpleSessionStater) Start() error { sess.Network, date(sess.SessionStart), duration(sess.SessionStart, sess.SessionClose), + // sess.DialerAddr, sess.ClientAddr, sess.TargetAddr, byteCountSI(atomic.LoadInt64(&sess.UploadBytes)), diff --git a/common/stats/stats.go b/common/stats/stats.go index 79e5a12..185449e 100644 --- a/common/stats/stats.go +++ b/common/stats/stats.go @@ -18,6 +18,7 @@ type SessionStater interface { type Session struct { ProcessName string Network string + DialerAddr string ClientAddr string TargetAddr string UploadBytes int64 diff --git a/proxy/socks/tcp.go b/proxy/socks/tcp.go index 30823ab..21a55ea 100644 --- a/proxy/socks/tcp.go +++ b/proxy/socks/tcp.go @@ -110,7 +110,8 @@ func (h *tcpHandler) Handle(localConn net.Conn, target *net.TCPAddr) error { sess = &stats.Session{ ProcessName: process, - Network: target.Network(), + Network: localConn.LocalAddr().Network(), + DialerAddr: remoteConn.LocalAddr().String(), ClientAddr: localConn.LocalAddr().String(), TargetAddr: targetAddr, UploadBytes: 0, diff --git a/proxy/socks/udp.go b/proxy/socks/udp.go index 199830c..c1ed712 100644 --- a/proxy/socks/udp.go +++ b/proxy/socks/udp.go @@ -175,6 +175,7 @@ func (h *udpHandler) connectInternal(conn core.UDPConn, targetAddr string) error sess := &stats.Session{ ProcessName: process, Network: conn.LocalAddr().Network(), + DialerAddr: remoteConn.LocalAddr().String(), ClientAddr: conn.LocalAddr().String(), TargetAddr: targetAddr, UploadBytes: 0,