-
Notifications
You must be signed in to change notification settings - Fork 402
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
fix: Ignore local/loopback traffic in IP connection limiter #2335
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: fd19441 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
apps/hubble/src/rpc/server.ts
Outdated
@@ -319,7 +319,7 @@ class IpConnectionLimiter { | |||
const ip = extractIPAddress(peerString) ?? "unknown"; | |||
|
|||
const connections = this.ipConnections.get(ip) ?? 0; | |||
if (connections >= this.perIpLimit) { | |||
if (ip !== "127.0.0.1" && connections >= this.perIpLimit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ipv6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a fair point, I just don't think people are using IPV6 for loopback communication. I'll follow up however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added IPv6 loopback IP to the list.
This allows the use of reverse proxies.
Why is this change needed?
This allows the use of reverse proxies.
Merge Checklist
PR-Codex overview
This PR focuses on enhancing the connection limiting functionality by ignoring local loopback IP traffic and modifying a test case.
Detailed summary
rateLimits.ts
to ignore both127.0.0.1
and::1
for local loopback traffic.server.ts
to exclude local IPs from the limit enforcement.eventService.test.ts
to skip the test case for excessive subscriptions.