Skip to content

Commit 538278e

Browse files
committed
docs(throttler): clarify websocket throttler definitions
Clarify that websocket handleRequest overrides run for each configured throttler set so named throttlers keep separate counters. Closes #3041
1 parent bd61991 commit 538278e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

content/security/rate-limiting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ There's a few things to keep in mind when working with WebSockets:
216216

217217
> info **Hint** If you are using the `@nestjs/platform-ws` package you can use `client._socket.remoteAddress` instead.
218218
219+
> info **Hint** When you configure [multiple throttler definitions](/security/rate-limiting#multiple-throttler-definitions), `handleRequest()` runs once for each throttler set. Use the `throttler.name` from `ThrottlerRequest` when generating the storage key and when reporting the `ThrottlerLimitDetail`, as shown above, so each named throttler tracks its own limit.
220+
219221
#### GraphQL
220222

221223
The `ThrottlerGuard` can also be used to work with GraphQL requests. Again, the guard can be extended, but this time the `getRequestResponse` method will be overridden

0 commit comments

Comments
 (0)