Add optional LWIP stack support

This commit is contained in:
世界 2022-08-07 17:15:29 +08:00
parent a937ff2d8d
commit 0fd822f913
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
18 changed files with 300 additions and 57 deletions

View file

@ -31,7 +31,7 @@ func NewUDPForwarder(ctx context.Context, stack *stack.Stack, handler Handler, u
ctx: ctx,
stack: stack,
handler: handler,
udpNat: udpnat.New[netip.AddrPort](udpTimeout, nopErrorHandler{handler}),
udpNat: udpnat.New[netip.AddrPort](udpTimeout, handler),
}
}
@ -120,10 +120,3 @@ func (w *UDPBackWriter) WritePacket(buffer *buf.Buffer, destination M.Socksaddr)
route.Stats().UDP.PacketsSent.Increment()
return nil
}
type nopErrorHandler struct {
Handler
}
func (h nopErrorHandler) NewError(ctx context.Context, err error) {
}