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: Add websocket limiter #17

Closed
1 task
MathurAditya724 opened this issue May 17, 2024 · 0 comments · Fixed by #18
Closed
1 task

feat: Add websocket limiter #17

MathurAditya724 opened this issue May 17, 2024 · 0 comments · Fixed by #18
Assignees
Labels
enhancement New feature or request

Comments

@MathurAditya724
Copy link
Member

  • Add new limiter for web sockets

Discussed in #15

Originally posted by mathysth May 13, 2024
Hey i'm using hono rate limiter with redis and it work perfectly for me except for socket.
So I was wondering does this library support socket rate limiter ?
I have attached my socket to the server with the following but I can spam the route as I want without any restriction:

this.server.hono.get(
      '/ws',
      upgradeWebSocket(() => {
        return {
          onMessage: async (event, ws) => {
            const response = await this.triggerEvent(event.data);
            if (response || response === false) {
              ws.send(JSON.stringify(response));
            }
          },
        }
      })
    )
```</div>
@MathurAditya724 MathurAditya724 added the enhancement New feature or request label May 17, 2024
@MathurAditya724 MathurAditya724 self-assigned this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant