MCPcopy Create free account
hub / github.com/Recordscript/recordscript / from_conf

Method from_conf

libs/hbb_common/src/proxy.rs:326–341  ·  view source on GitHub ↗
(conf: &Socks5Server, ms_timeout: Option<u64>)

Source from the content-addressed store, hash-verified

324 }
325
326 pub fn from_conf(conf: &Socks5Server, ms_timeout: Option<u64>) -> Result<Self, ProxyError> {
327 let mut proxy;
328 match ms_timeout {
329 None => {
330 proxy = Self::new(&conf.proxy, DEFINE_TIME_OUT)?;
331 }
332 Some(time_out) => {
333 proxy = Self::new(&conf.proxy, time_out)?;
334 }
335 }
336
337 if !conf.password.is_empty() && !conf.username.is_empty() {
338 proxy = proxy.basic_auth(&conf.username, &conf.password);
339 }
340 Ok(proxy)
341 }
342
343 pub async fn proxy_addrs(&self) -> Result<SocketAddr, ProxyError> {
344 self.intercept.socket_addrs().await

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.80
basic_authMethod · 0.80

Tested by

no test coverage detected