This commit is contained in:
ginuerzh
2022-01-28 11:57:26 +08:00
parent 397a13bcdb
commit b2b76a10a0
6 changed files with 54 additions and 105 deletions

View File

@ -109,10 +109,10 @@ func (h *ssuHandler) Handle(ctx context.Context, conn net.Conn) {
}
t := time.Now()
log.Infof("%s <-> %s", conn.RemoteAddr(), cc.LocalAddr())
log.Infof("%s <-> %s", conn.LocalAddr(), cc.LocalAddr())
h.relayPacket(pc, cc, log)
log.WithFields(map[string]interface{}{"duration": time.Since(t)}).
Infof("%s >-< %s", conn.RemoteAddr(), cc.LocalAddr())
Infof("%s >-< %s", conn.LocalAddr(), cc.LocalAddr())
}
func (h *ssuHandler) relayPacket(pc1, pc2 net.PacketConn, log logger.Logger) (err error) {