vicanso / pingap

A reverse proxy like nginx, built on pingora, simple and efficient.
http://pingap.io/pingap-zh/
Apache License 2.0
314 stars 19 forks source link

Implement an AccessRateLimit plugin via pingora Access struct. #9

Closed WENPIN1 closed 5 months ago

WENPIN1 commented 5 months ago

implement an AccessRateLimit plugin via pingora Access struct.

The detailed implementation might be easily composed like present pingap Limiter that uses pingora Rate struct instead of Inflight struct Be aware of the Rate struct which frequency is per second rate estimation, but we may use human time to convert the access frequency rule to accommodate the Rate struct.

Thank you!

-WENPIN

vicanso commented 5 months ago

Limit plugin supports two limiters: inflight and rate.

https://github.com/vicanso/pingap/blob/main/src/plugin/limit.rs#L98

WENPIN1 commented 5 months ago

Thanks for your handsome work!

-WENPIN1