Skip to content

Commit

Permalink
[add] request log
Browse files Browse the repository at this point in the history
  • Loading branch information
benyamin218118 committed Feb 28, 2023
1 parent a61dfc7 commit e4f456b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions forwarder.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package main

import (
"fmt"
"io"
"net"
"time"
)

type Forwarder struct {
Expand Down Expand Up @@ -34,6 +36,7 @@ func (f *Forwarder) Start() {
_ = srcConn.Close()
return
}
println(fmt.Sprintf(`%s -- %s <-> %s`, time.Now().Format(time.RFC3339), srcConn.RemoteAddr().String(), f.dst.String()))
go func(srcConn, dstConn net.Conn) {
_, _ = io.Copy(srcConn, dstConn)
_ = srcConn.Close()
Expand Down
Binary file modified tcpforwarder
Binary file not shown.

0 comments on commit e4f456b

Please sign in to comment.