From 0725413b80a3aa50d615053ee1d86bc4cf8ce82a Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 11 Aug 2019 18:05:58 +0800 Subject: [PATCH] remove 'Dialer Addr' from stats.Session --- common/stats/session/session.go | 5 ++--- common/stats/stats.go | 1 - proxy/socks/tcp.go | 1 - proxy/socks/udp.go | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/common/stats/session/session.go b/common/stats/session/session.go index b091831..b832d7e 100644 --- a/common/stats/session/session.go +++ b/common/stats/session/session.go @@ -55,18 +55,17 @@ func (s *simpleSessionStater) Start() error { return sessions[i].SessionStart.Sub(sessions[j].SessionStart) < 0 }) _, _ = fmt.Fprintf(w, "") - _, _ = fmt.Fprintf(w, "") + _, _ = fmt.Fprintf(w, "") sort.Slice(sessions, func(i, j int) bool { return sessions[i].SessionStart.After(sessions[j].SessionStart) }) for _, sess := range sessions { - _, _ = fmt.Fprintf(w, "", + _, _ = fmt.Fprintf(w, "", sess.ProcessName, sess.Network, date(sess.SessionStart), duration(sess.SessionStart, sess.SessionClose), - sess.DialerAddr, sess.ClientAddr, sess.TargetAddr, p.Sprintf("%d", atomic.LoadInt64(&sess.UploadBytes)), diff --git a/common/stats/stats.go b/common/stats/stats.go index 185449e..79e5a12 100644 --- a/common/stats/stats.go +++ b/common/stats/stats.go @@ -18,7 +18,6 @@ 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 5e8fd26..ae89f1e 100644 --- a/proxy/socks/tcp.go +++ b/proxy/socks/tcp.go @@ -93,7 +93,6 @@ func (h *tcpHandler) Handle(localConn net.Conn, target *net.TCPAddr) error { sess = &stats.Session{ ProcessName: process, Network: target.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 c1ed712..199830c 100644 --- a/proxy/socks/udp.go +++ b/proxy/socks/udp.go @@ -175,7 +175,6 @@ 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,
Process NameNetworkDateDurationDialer AddrClient AddrTarget AddrUpload BytesDownload Bytes
Process NameNetworkDateDurationClient AddrTarget AddrUpload BytesDownload Bytes
%v%v%v%v%v%v%v%v%v
%v%v%v%v%v%v%v%v