Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ws): websocket connection cooldown time #343

Open
1 task done
Tracked by #335
Trantorian1 opened this issue Oct 15, 2024 · 0 comments
Open
1 task done
Tracked by #335

feat(ws): websocket connection cooldown time #343

Trantorian1 opened this issue Oct 15, 2024 · 0 comments
Labels
help wanted Extra attention is needed rpc-0.8.0 Implementation of the new rpc specs

Comments

@Trantorian1
Copy link
Collaborator

Trantorian1 commented Oct 15, 2024

Is there an existing issue?

  • I have searched the existing issues

Motivation

See #335 for more information about implementing rpc v0.8.0-rc0 in Madara.

Request

Add a cmd-line option to set a cooldown time for websocket re-connections coming from the same IP, with the option for no cooldown (defaults to some cooldown). This should work in the following way:

  • When a client ends their connection, they need to wait a set time t before they can re-connect.
  • After t has elapsed, they are unblocked and can request a new ws connection for that method.

This should work on a per-method basis, so a client subscribing to a new ws rpc method A does not activate the cooldown for another method B, but when they unsubscribe from A they need to wait for a duration of t before they can subscribe to A again. This acts as a simple form of rate limiting, preventing excessive re-connections.

Note

It might also be worth considering banning IPs which repeatedly request to connect within their cooldown period, in which case this should be toggled via a separate cmd-line flag

Solution

Solution should be integrated into a separate param struct along with other websocket rpc arguments. See #341 and #342 for more information.

Are you willing to help with this request?

Yes!

@Trantorian1 Trantorian1 added help wanted Extra attention is needed rpc-0.8.0 Implementation of the new rpc specs labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed rpc-0.8.0 Implementation of the new rpc specs
Projects
None yet
Development

No branches or pull requests

1 participant