update registry
This commit is contained in:
@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegisterHandler("tun", NewHandler)
|
||||
registry.HandlerRegistry().Register("tun", NewHandler)
|
||||
}
|
||||
|
||||
type tunHandler struct {
|
||||
@ -94,14 +94,14 @@ func (h *tunHandler) Handle(ctx context.Context, conn net.Conn) {
|
||||
}
|
||||
|
||||
start := time.Now()
|
||||
log = log.WithFields(map[string]interface{}{
|
||||
log = log.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
})
|
||||
|
||||
log.Infof("%s <> %s", conn.RemoteAddr(), conn.LocalAddr())
|
||||
defer func() {
|
||||
log.WithFields(map[string]interface{}{
|
||||
log.WithFields(map[string]any{
|
||||
"duration": time.Since(start),
|
||||
}).Infof("%s >< %s", conn.RemoteAddr(), conn.LocalAddr())
|
||||
}()
|
||||
@ -117,7 +117,7 @@ func (h *tunHandler) Handle(ctx context.Context, conn net.Conn) {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
log = log.WithFields(map[string]interface{}{
|
||||
log = log.WithFields(map[string]any{
|
||||
"dst": fmt.Sprintf("%s/%s", raddr.String(), raddr.Network()),
|
||||
})
|
||||
log.Infof("%s >> %s", conn.RemoteAddr(), target.Addr)
|
||||
|
Reference in New Issue
Block a user