diff --git a/lib/tun2/server.go b/lib/tun2/server.go index 7d3b04e..12253c0 100644 --- a/lib/tun2/server.go +++ b/lib/tun2/server.go @@ -340,6 +340,12 @@ func (s *Server) HandleConn(c net.Conn, isKCP bool) { Auth: auth, } + defer func() { + if r := recover(); r != nil { + ln.Log(connection, ln.F{"action": "connection handler panic", "err": r}) + } + }() + ln.Log(ln.F{ "action": "backend_connected", }, connection.F())