Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ cargo new load_balancer
In your project's `cargo.toml` file add the following to your dependencies
```
async-trait="0.1"
pingora = { version = "0.3", features = [ "lb" ] }
pingora = { version = "0.8.0", features = ["openssl", "lb"] }

```

### Create a pingora server
Expand Down Expand Up @@ -321,4 +322,4 @@ The full code for this example is available in this repository under
Other examples that you may find helpful are also available here

[pingora-proxy/examples/](../pingora-proxy/examples/)
[pingora/examples](../pingora/examples/)
[pingora/examples](../pingora/examples/)
5 changes: 3 additions & 2 deletions docs/user_guide/rate_limiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Pingora provides a crate `pingora-limits` which provides a simple and easy to us
1. Add the following dependencies to your `Cargo.toml`:
```toml
async-trait="0.1"
pingora = { version = "0.3", features = [ "lb" ] }
pingora-limits = "0.3.0"
pingora = { version = "0.8", features = [ "lb", "openssl" ] }
pingora-limits = "0.8.0"
once_cell = "1.19.0"
```
2. Declare a global rate limiter map to store the rate limiter for each client. In this example, we use `appid`.
Expand All @@ -20,6 +20,7 @@ Pingora provides a crate `pingora-limits` which provides a simple and easy to us
```rust
use async_trait::async_trait;
use once_cell::sync::Lazy;
use pingora::http::ResponseHeader;
use pingora::prelude::*;
use pingora_limits::rate::Rate;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion pingora-proxy/examples/connection_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct BlockAllFilter;

#[async_trait]
impl ConnectionFilter for BlockAllFilter {
async fn should_accept(&self, addr: &std::net::SocketAddr) -> bool {
fn should_accept(&self, addr: &std::net::SocketAddr) -> bool {
info!("BLOCKING connection from {} (BlockAllFilter active)", addr);
false
}
Expand Down