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

Ratelimit handler support #61

Closed
gojihotsauce opened this issue May 11, 2022 · 4 comments
Closed

Ratelimit handler support #61

gojihotsauce opened this issue May 11, 2022 · 4 comments

Comments

@gojihotsauce
Copy link

Hello everyone,

Are we able to leverage the ratelimit handler within a layer4 listener using proxy protocol?

Thanks!

@mholt
Copy link
Owner

mholt commented May 11, 2022

You want to rate limit HTTP requests without decoding HTTP, or... what is your goal? What are you trying to do?

@gojihotsauce
Copy link
Author

gojihotsauce commented May 12, 2022

You want to rate limit HTTP requests without decoding HTTP, or... what is your goal? What are you trying to do?

Hi @mholt

I'd like to be able to rate limit behind an AWS NLB that uses proxy protocol with Caddy as a target, which terminates TLS and then proxies to another application. In this scenario Caddy is responsible for all TLS traffic and uses a few CEL/http matchers.

NLB --Proxy Protocol--> Caddy -> Rate limit -> TLS termination -> app

@ydylla
Copy link
Collaborator

ydylla commented May 12, 2022

Hi @gojihotsauce,
I think you don't need layer4 for that.

You can use the caddy2-proxyprotocol listen wrapper to handle the incoming proxy protocol with caddy.
But I just noticed there is an open issue for a similar AWS NLB setup, so maybe you have to try it with caddy-go-proxyproto.

Even if layer4 would have a rate limiter, it would most likely operate on connection level. Meaning once a connection is established multiple http requests can be sent over it. These requests would then bypass the rate limiter, which is probably not what you want.

@gojihotsauce
Copy link
Author

Thank you @ydylla! This helps point me in the right direction. I'll close this issue for now. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants