tun2socks

Crates.iotun2socks
lib.rstun2socks
version0.1.5
sourcesrc
created_at2023-06-03 16:05:22.500352
updated_at2024-11-20 05:57:56.485381
descriptionHigh performance tun2socks
homepage
repositoryhttps://github.com/heiher/tun2socks
max_upload_size
id881742
size4,637,870
hev (heiher)

documentation

README

Tun2Socks

Rust bindings for HevSocks5Tunnel

Features

  • IPv4/IPv6. (dual stack)
  • Redirect TCP connections.
  • Redirect UDP packets. (Fullcone NAT, UDP in UDP/TCP)
  • Linux/Android/FreeBSD/macOS/iOS.

Benchmarks

See here for more details.

Speed

CPU usage

Memory usage

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()

Contributors

License

MIT

Commit count: 21

cargo fmt