-
Notifications
You must be signed in to change notification settings - Fork 11
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
Connection limiter #415
base: dev
Are you sure you want to change the base?
Connection limiter #415
Conversation
rpc_sidecar/src/rpcs.rs
Outdated
let limiter = Arc::new(DefaultKeyedRateLimiter::keyed(Quota::per_second(qps_limit))); | ||
|
||
// Try to get client's IP address from headers, with fallback to connection IP address. | ||
let host_ip = warp::header(X_REAL_IP) |
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.
do we need this?
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.
Yes, for reverse proxies.
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.
Where do we use reverse proxies?
rpc_sidecar/src/rpcs.rs
Outdated
.and_then(move |ip_addr: IpAddr| { | ||
let limiter = limiter.clone(); | ||
async move { | ||
if let Err(negative) = limiter.check_key(&ip_addr) { |
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.
I thought we don't do ip-based limiting?
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.
I'd say it's a nice-to-have feature.
No description provided.