mirror of
https://github.com/mmatczuk/go-http-tunnel.git
synced 2026-05-21 06:45:30 -06:00
server: http log sent bytes
This commit is contained in:
parent
1bbcb98198
commit
7849170e92
2 changed files with 14 additions and 1 deletions
|
|
@ -252,8 +252,10 @@ func (s *Server) proxy(host string, w io.Writer, r interface{}, msg *proto.Contr
|
|||
|
||||
localToRemote := func() {
|
||||
if hr, ok := r.(*http.Request); ok {
|
||||
hr.Write(pw)
|
||||
cw := &countWriter{pw, 0}
|
||||
hr.Write(cw)
|
||||
pw.Close()
|
||||
s.log.Debug("Coppied %d bytes from %s", cw.count, "local to remote")
|
||||
} else {
|
||||
transfer("local to remote", pw, r.(io.ReadCloser), s.log)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue