Skip to content

Commit 64e8a5c

Browse files
Merge pull request #3444 from iambeaukim/docs/ws-throttler-multiple-definitions
docs(throttler): clarify websocket throttler definitions
2 parents bd61991 + 538278e commit 64e8a5c

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)