hysteria2 0.1.6

A feature-rich, asynchronous Rust client library for the Hysteria 2 proxy protocol. / 功能丰富、异步的 Hysteria 2 代理协议 Rust 客户端库。
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::HysteriaError;

/// Resolve server address.
/// 解析服务器地址。
pub(crate) async fn resolve_server_address(
  server_addr: &str,
) -> Result<std::net::SocketAddr, HysteriaError> {
  tokio::net::lookup_host(server_addr)
    .await?
    .next()
    .ok_or_else(|| HysteriaError::InvalidAddress(server_addr.to_string()))
}