Skip to main content

gooty_proxy/
lib.rs

1//! # Gooty Proxy
2//!
3//! A robust library for discovering, testing, and managing HTTP and SOCKS proxies.
4//!
5//! ## Overview
6//!
7//! Gooty Proxy provides tools for working with proxy servers, including:
8//!
9//! * Discovery of proxy servers from various sources
10//! * Validation and testing of proxies for connectivity and anonymity
11//! * Collection of metadata about proxies (location, organization, ASN)
12//! * Management of proxy pools for rotation and failover
13//! * Persistence of proxy data for reuse across sessions
14//!
15//! The library is designed to be both easy to use for simple cases and highly
16//! configurable for advanced use cases.
17//!
18//! ## Examples
19//!
20//! ```
21//! use gooty_proxy::ProxyManager;
22//!
23//! async fn example() -> Result<(), Box<dyn std::error::Error>> {
24//!     // Create a new proxy manager
25//!     let mut manager = ProxyManager::new()?;
26//!
27//!     // Initialize components
28//!     manager.init_judge().await?;
29//!     manager.init_sleuth()?;
30//!
31//!     // Add a proxy to test
32//!     let proxy_url = "http://example.com:8080";
33//!     manager.add_proxy_from_url(proxy_url)?;
34//!
35//!     // Test the proxy
36//!     manager.check_proxy(proxy_url).await?;
37//!
38//!     // Get detailed information about the proxy
39//!     manager.enrich_proxy(proxy_url).await?;
40//!
41//!     // Get a reference to the tested proxy
42//!     if let Some(proxy) = manager.get_proxy(proxy_url) {
43//!         println!("Proxy type: {}", proxy.proxy_type);
44//!         println!("Anonymity: {}", proxy.anonymity);
45//!         if let Some(country) = &proxy.country {
46//!             println!("Country: {}", country);
47//!         }
48//!     }
49//!
50//!     Ok(())
51//! }
52//! ```
53
54//#![allow(unsafe_code)]
55#![warn(missing_docs)]
56#![allow(clippy::multiple_crate_versions)]
57
58use mimalloc::MiMalloc;
59
60#[global_allocator]
61static GLOBAL: MiMalloc = MiMalloc;
62
63pub mod config;
64pub mod definitions;
65pub mod inspection;
66pub mod io;
67pub mod orchestration;
68pub mod utils;
69
70// Re-export main types for easier access
71pub use config::{AppConfig, ConfigLoader};
72pub use definitions::{
73    defaults,
74    enums::{AnonymityLevel, ProxyType},
75    errors::{ConfigError, ConfigResult, ProxyError, SourceError, SourceResult},
76    proxy::Proxy,
77    source::Source,
78};
79pub use inspection::{
80    Cidr, IpMetadata, Judge, Location, NetworkInfo, Organization, OwnershipLookup, Sleuth,
81};
82pub use io::{
83    filesystem::{Filestore, FilestoreConfig},
84    http::Requestor,
85};
86pub use orchestration::manager::{ProxyManager, ProxyStats, SourceStats};