Function
new_udp
(local: T, ms_timeout: u64)
Source from the content-addressed store, hash-verified
| 184 | } |
| 185 | |
| 186 | async fn new_udp<T: ToSocketAddrs>(local: T, ms_timeout: u64) -> ResultType<FramedSocket> { |
| 187 | match Config::get_socks() { |
| 188 | None => Ok(FramedSocket::new(local).await?), |
| 189 | Some(conf) => { |
| 190 | let socket = FramedSocket::new_proxy( |
| 191 | conf.proxy.as_str(), |
| 192 | local, |
| 193 | conf.username.as_str(), |
| 194 | conf.password.as_str(), |
| 195 | ms_timeout, |
| 196 | ) |
| 197 | .await?; |
| 198 | Ok(socket) |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | pub async fn rebind_udp_for( |
| 204 | target: &str, |
Tested by
no test coverage detected