2 个版本
使用旧的 Rust 2015
0.1.4 | 2024 年 3 月 14 日 |
---|---|
0.1.3 | 2024 年 2 月 15 日 |
0.1.2 |
|
0.1.1 |
|
0.0.2 |
|
#1198 in 网络编程
267 每月下载量
3MB
69K SLoC
Tun2Socks
Rust 对 HevSocks5Tunnel 的绑定
特性
- IPv4/IPv6。 (双栈)
- 重定向 TCP 连接。
- 重定向 UDP 数据包。 (Fullcone NAT,UDP 在 UDP/TCP)
- Linux/Android/FreeBSD/macOS/iOS。
基准测试
更多详情请见 这里。
速度
CPU 使用率
内存使用率
API
/// Start and run the socks5 tunnel, this function will blocks until the
/// quit() is called or an error occurs.
///
/// # Arguments
///
/// * `config_path` - config file path
/// * `tun_fd` - tunnel file descriptor
///
/// # Returns
///
/// Returns Ok(()) on successful, otherwise returns Err(r).
pub fn main_from_file(config_path: &Path, tun_fd: RawFd) -> Result<(), i32>
/// Start and run the socks5 tunnel, this function will blocks until the
/// quit() is called or an error occurs.
///
/// # Arguments
///
/// * `config_str` - config string
/// * `tun_fd` - tunnel file descriptor
///
/// # Returns
///
/// Returns Ok(()) on successful, otherwise returns Err(r).
pub fn main_from_str(config_str: &str, tun_fd: RawFd) -> Result<(), i32>
/// Stop the socks5 tunnel.
pub fn quit()
贡献者
- hev - https://hev.cc
- pronebird - https://github.com/pronebird
许可证
MIT