pub struct Shadowsocks {
pub host: String,
pub port: u32,
pub password: String,
pub method: String,
}
Expand description
Represents a Shadowsocks proxy.
Fields§
§host: String
The host address of the Shadowsocks proxy.
port: u32
The port number for the Shadowsocks proxy.
password: String
The password associated with the Shadowsocks proxy.
method: String
The encryption method used by the Shadowsocks proxy.
Implementations§
Source§impl Shadowsocks
impl Shadowsocks
Sourcepub fn to_url(&self) -> String
pub fn to_url(&self) -> String
Converts the Shadowsocks proxy information into a Shadowsocks URL.
§Example
use proxy_scraper::shadowsocks::Shadowsocks;
let proxy = Shadowsocks {
host: "example.com".to_string(),
port: 443,
password: "password".to_string(),
method: "aes-256-gcm".to_string(),
};
let url = proxy.to_url();
assert_eq!(url, "ss://YWVzLTI1Ni1nY206cGFzc3dvcmQ=@example.com:443");
Sourcepub fn scrape(source: &str) -> Vec<Self>
pub fn scrape(source: &str) -> Vec<Self>
Scrapes Shadowsocks proxy information from the provided source string and returns a vector of Shadowsocks instances.
§Arguments
source
- A string containing the source code or text from which to extract Shadowsocks proxy information.
§Returns
A vector of Shadowsocks
instances parsed from the source string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shadowsocks
impl RefUnwindSafe for Shadowsocks
impl Send for Shadowsocks
impl Sync for Shadowsocks
impl Unpin for Shadowsocks
impl UnwindSafe for Shadowsocks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more