Crates.io | proxier |
lib.rs | proxier |
version | 0.1.7 |
source | src |
created_at | 2024-10-04 16:57:08.019704 |
updated_at | 2024-11-02 23:44:14.497184 |
description | Auto proxy whitelist and delist crate for 3rd party services. |
homepage | |
repository | https://github.com/spider-rs/proxier |
max_upload_size | |
id | 1396798 |
size | 29,837 |
The auto white-listing proxy API lib for Rust.
cargo add proxier
Example
use proxier::proxies::{Proxier, IPRoyaleConfiguration, WebShareConfiguration, DatainpulseConfiguration, EvomiConfiguration};
#[tokio::main]
async fn main() {
// replace with the server ip
let mut proxier = Proxier::new("124.32.334.2");
let iproyale_config = IPRoyaleConfiguration::default();
let webshare_config = WebShareConfiguration::default();
let datainpulse_config = DatainpulseConfiguration::default();
let evomi_config = EvomiConfiguration::default();
// setup all the configs for the proxies.
proxier.setup_proxies(Some(iproyale_config), Some(webshare_config), Some(datainpulse_config), Some(evomi_config)).await;
// whitelist the server
proxier.whitelist().await;
// add signals with startup on the server to delist after shutdown using tokio::select etc.
// delist the proxiers for the server after.
proxier.delist().await;
}
The following env variables are required to set.
PROXY_SHARE_PASSWORD
IP_ROYALE_API_TOKEN
DATA_INPULSE_USERNAME
DATA_INPULSE_PASSWORD
EVOMI_API_TOKEN