Rate limiting websocket messages #12
Labels
No labels
Good First Issue
Help wanted
Kind/Breaking
Kind/Bug
Kind/Bug Fix
Kind/CI-CD
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Question
Kind/Security
Kind/Testing
Reviewed
Accepted
Reviewed
Confirmed
Reviewed
Declined
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Approved
Status
Blocked
Status
Inactive
Status
Need More Info
Status
Waiting On Author
Status
Waiting On Review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: OxideTalis/oxidetalis#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now, the websocket server is not rate limiting the messages. This can be a
problem if a user sends a lot of messages in a short period of time. This can be
used to spam the server and cause a denial of service.
I think about storing the connection ratelimit data in the
SocketUserData
struct, and then check if the user has reached the limit before handling its
message.
@Amjad50, what do you think is better, using
limit
andperiod_secs
from theratelimit
section in the config file, or creating a new configuration for the websocket rate limit?it seems fine to use the same config file, since its the server config. why would you want to use a new file specifically for rate limiting?
Also, if this is per connection, maybe its better to include this in the name, like
connection_ratelimit
.Another thing I thought about, would it be interesting idea to also add limit to number of connections? I know ws is light and we can handle many, but just to fend against half open connections attacks
Not new file, new configuration, like you say
connection_ratelimit
underratelimit
section.So the new configurations will be
connection_limit
underratelimit
sectionconnection_period_secs
underratelimit
sectionThere is an issue for this: #11
The current configuration is
So it would be like this?
or keep the old fields and add these new ones?
No, it will be:
ah, sorry got confused
then, I think we can put them separate, and we can even use the same structure to make it clear which is websocket and which is http, the name
connection
isn't clear, something like thisI like this, agreed