mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 06:09:37 +00:00
remove rate limiter, let gatekeeper handle it
This commit is contained in:
@@ -67,16 +67,6 @@ export function startWorker() {
|
||||
}),
|
||||
);
|
||||
|
||||
const rateLimiter = new RateLimiterMemory({
|
||||
points: 50, // 50 messages
|
||||
duration: 1, // per 1 second
|
||||
});
|
||||
|
||||
const updateRateLimiter = new RateLimiterMemory({
|
||||
points: 10,
|
||||
duration: 240, // 4 minutes
|
||||
});
|
||||
|
||||
// Endpoint to create a private lobby
|
||||
app.post(
|
||||
"/create_game/:id",
|
||||
@@ -216,12 +206,6 @@ export function startWorker() {
|
||||
const ip = Array.isArray(forwarded)
|
||||
? forwarded[0]
|
||||
: forwarded || req.socket.remoteAddress;
|
||||
try {
|
||||
await rateLimiter.consume(ip);
|
||||
} catch (error) {
|
||||
console.warn(`rate limit exceeded for ${ip}`);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Process WebSocket messages as in your original code
|
||||
|
||||
Reference in New Issue
Block a user