Add tun inbound for linux

This commit is contained in:
世界
2022-07-09 19:18:37 +08:00
parent c463d0cf80
commit 730144cc26
19 changed files with 623 additions and 22 deletions

View File

@@ -231,12 +231,16 @@ func (a *myInboundAdapter) newError(err error) {
}
func (a *myInboundAdapter) NewError(ctx context.Context, err error) {
NewError(a.logger, ctx, err)
}
func NewError(logger log.Logger, ctx context.Context, err error) {
common.Close(err)
if E.IsClosed(err) {
a.logger.WithContext(ctx).Debug("connection closed")
logger.WithContext(ctx).Debug("connection closed")
return
}
a.logger.WithContext(ctx).Error(err)
logger.WithContext(ctx).Error(err)
}
func (a *myInboundAdapter) writePacket(buffer *buf.Buffer, destination M.Socksaddr) error {