mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 16:05:12 +00:00
Come up with better limits
This commit is contained in:
parent
aff57333d5
commit
c5f7dcbb7e
1 changed files with 4 additions and 4 deletions
|
@ -98,8 +98,8 @@ export class StreamingApiServerService {
|
||||||
|
|
||||||
if (await this.rateLimitThis(null, requestIp, {
|
if (await this.rateLimitThis(null, requestIp, {
|
||||||
key: 'wsconnect',
|
key: 'wsconnect',
|
||||||
duration: ms('1min'),
|
duration: ms('5min'),
|
||||||
max: 20,
|
max: 32,
|
||||||
minInterval: ms('1sec'),
|
minInterval: ms('1sec'),
|
||||||
})) {
|
})) {
|
||||||
socket.write('HTTP/1.1 429 Rate Limit Exceeded\r\n\r\n');
|
socket.write('HTTP/1.1 429 Rate Limit Exceeded\r\n\r\n');
|
||||||
|
@ -147,8 +147,8 @@ export class StreamingApiServerService {
|
||||||
const rateLimiter = () => {
|
const rateLimiter = () => {
|
||||||
return this.rateLimitThis(user, requestIp, {
|
return this.rateLimitThis(user, requestIp, {
|
||||||
key: 'wsmessage',
|
key: 'wsmessage',
|
||||||
duration: ms('1sec'),
|
duration: ms('5sec'),
|
||||||
max: 100,
|
max: 256,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue