diff --git a/packages/socket.io/lib/socket.ts b/packages/socket.io/lib/socket.ts index 96d11a557..3689fd9d8 100644 --- a/packages/socket.io/lib/socket.ts +++ b/packages/socket.io/lib/socket.ts @@ -842,6 +842,10 @@ export class Socket< * if (isUnauthorized(event)) { * return next(new Error("unauthorized event")); * } + * if (shouldDrop(event)) { + * // return without next() to silently drop the packet + * return; + * } * // do not forget to call next * next(); * });