WebSocket gateways support guards, interceptors, pipes, and filters but not middleware — middleware is HTTP-only. Guards use ctx.switchToWs().getClient() to access the socket. Exception filters use host.switchToWs(). The same enhancer class can support both HTTP and WebSocket by checking ctx.getType().
Middleware — HTTP only; WebSocket connections skip the middleware layer entirely.
Guards — supported on gateways; use ctx.switchToWs().getClient() for socket access.
Interceptors — supported on gateways; wrap @SubscribeMessage handlers.
Pipes — supported on @MessageBody() and @ConnectedSocket() parameters.
Filters — supported; use host.switchToWs() to access the socket and data.
WsException should be thrown in WebSocket context instead of HttpException.