From 4c5375a4298c27f3f669d2ac6ef7994d5d44e164 Mon Sep 17 00:00:00 2001 From: 0ceanSlim Date: Fri, 26 Jul 2024 10:40:31 -0400 Subject: [PATCH] config example changed, some comments removed --- config.example.yml | 23 +++++++++++------------ main.go | 1 - relay/handlers/event.go | 1 - relay/utils/rateLimiter.go | 1 - 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/config.example.yml b/config.example.yml index 0122610..bc970f5 100644 --- a/config.example.yml +++ b/config.example.yml @@ -6,19 +6,18 @@ server: port: ":8080" # Port for the server to listen on rate_limit: - #WS is not working as intended. It's only working for accepting Events, which is what event is supposed to do - ws_limit: 100 # Global rate limit for WebSocket messages (50 messages per second) - ws_burst: 200 # Global burst limit for WebSocket messages (allows a burst of 100 messages) - #event limit doesn't seem to work either - event_limit: 50 # Global rate limit for events (25 events per second) - event_burst: 100 # Global burst limit for events (allows a burst of 50 events) + ws_limit: 100 # Global rate limit for WebSocket messages (100 messages per second) + ws_burst: 200 # Global burst limit for WebSocket messages (allows a burst of 200 messages) + + event_limit: 50 # Global rate limit for events (50 events per second) + event_burst: 100 # Global burst limit for events (allows a burst of 100 events) req_limit: 50 # Added limit for REQ messages req_burst: 100 # Added burst limit for REQ messages category_limits: # Rate limits based on event categories regular: - limit: 25 # Rate limit for regular events (50 events per second) - burst: 50 # Burst limit for regular events (allows a burst of 100 events) + limit: 25 # Rate limit for regular events (25 events per second) + burst: 50 # Burst limit for regular events (allows a burst of 50 events) replaceable: limit: 10 # Rate limit for replaceable events (10 events per second) burst: 20 # Burst limit for replaceable events (allows a burst of 20 events) @@ -34,8 +33,8 @@ rate_limit: limit: 1 # Rate limit for events of kind 0 (1 event per second) burst: 5 # Burst limit for events of kind 0 (allows a burst of 5 events) - kind: 1 - limit: 25 # Rate limit for events of kind 1 (100 events per second) - burst: 50 # Burst limit for events of kind 1 (allows a burst of 200 events) + limit: 25 # Rate limit for events of kind 1 (25 events per second) + burst: 50 # Burst limit for events of kind 1 (allows a burst of 50 events) - kind: 3 - limit: 10 # Rate limit for events of kind 3 (25 events per second) - burst: 20 # Burst limit for events of kind 3 (allows a burst of 50 events) + limit: 25 # Rate limit for events of kind 3 (25 events per second) + burst: 50 # Burst limit for events of kind 3 (allows a burst of 50 events) diff --git a/main.go b/main.go index 02bcf38..e9b55ac 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,3 @@ -// main.go package main import ( diff --git a/relay/handlers/event.go b/relay/handlers/event.go index 74b5322..f5f4d58 100644 --- a/relay/handlers/event.go +++ b/relay/handlers/event.go @@ -1,4 +1,3 @@ -// event.go package handlers import ( diff --git a/relay/utils/rateLimiter.go b/relay/utils/rateLimiter.go index 4a24b61..b882e60 100644 --- a/relay/utils/rateLimiter.go +++ b/relay/utils/rateLimiter.go @@ -1,4 +1,3 @@ -// rateLimiter.go package utils import (