# Install tun2proxy with Homebrew, Nix

Tunnel (TUN) interface for SOCKS and HTTP proxies. Version 0.8.2 via Homebrew; verified 2026-06-08.

## Install

```sh
sudo av install brew:tun2proxy
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install tun2proxy
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#tun2proxy
```

  Evidence: nixpkgs package indexes: pkgs/by-name/tu/tun2proxy/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:tun2proxy
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/tun2proxy>
- **Version:** 0.8.2
- **Source summary:** Tunnel (TUN) interface for SOCKS and HTTP proxies
- **Homepage:** <https://github.com/tun2proxy/tun2proxy>
- **Repository:** <https://github.com/tun2proxy/tun2proxy>
- **Upstream docs:** <https://github.com/tun2proxy/tun2proxy>
- **License:** MIT
- **Source archive:** <https://github.com/tun2proxy/tun2proxy/archive/refs/tags/v0.8.2.tar.gz>
- **Last updated:** 2026-06-08T10:20:14Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- tun2proxy-bin (cli)
- udpgw-server (cli)
- tun2proxy-bin (alias)
- udpgw-server (alias)

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.8.2
- Package-manager updated: 2026-06-08
- Local data: ok
- Upstream repository: https://github.com/tun2proxy/tun2proxy
- Upstream latest detected: v0.8.2 (current)
## Project history and usage

tun2proxy is a Rust networking tool that exposes a tunnel interface for routing traffic through HTTP and SOCKS proxies on Linux, Android, macOS, iOS, and Windows. It sits in the niche between VPN-style TUN devices and ordinary application-level proxy settings.

### Project history

The README presents tun2proxy as a cross-platform TUN interface for HTTP and SOCKS proxies, with support for SOCKS4, SOCKS4a, SOCKS5, SOCKS5h, HTTP proxy authentication modes, IPv4, IPv6, UDP handling, virtual DNS, DNS-over-TCP proxying, UdpGW, Android per-app routing metadata, and automated setup.

The project has evolved toward operational deployment rather than only library use. Official documentation covers building Apple XCFrameworks, installing binaries from GitHub releases, installing from source with cargo, verifying release artifacts through GitHub build provenance attestations since v0.2.23, and running tun2proxy as a Docker sidecar for other containers.

### Adoption history

Official installation paths include GitHub release binaries and `cargo install tun2proxy`; the input package facts record Homebrew and Nix packages. That mix is typical for lower-level networking tools: source builds for Rust users, binary releases for operators, and package-manager formulas for workstation or server bootstrap.

The README's Docker and Docker Compose examples show adoption beyond interactive CLI use. The documented pattern is to run tun2proxy with NET_ADMIN and /dev/net/tun, then share the resulting network namespace with another container, similar to a sidecar proxy pattern.

### How it is used

Users provide a proxy URL with `--proxy`, optionally create or name a TUN interface with `--tun`, use `--setup` to configure routing automatically, and choose DNS handling with `--dns direct`, `--dns over-tcp`, or `--dns virtual`. Manual setup examples route broad IPv4 and optional IPv6 ranges through tun0 while bypassing the proxy server itself to avoid routing loops.

For Android 10+ per-app routing, the README documents embedding protocol, source IP, and source port into the SOCKS5 username field by appending `+info` to the username. For container workflows, tun2proxy can become the network namespace provider for another container.

### Why package nerds care

tun2proxy is significant to package nerds because it solves a classic mismatch: many programs obey system routes or TUN devices, while many cheap or specialized proxy providers expose only HTTP or SOCKS endpoints. A package-installable tun2proxy lets users turn a proxy URL into something that looks closer to a VPN path.

Its appeal is strongest among users who understand TUN devices, routing tables, DNS leaks, Docker namespaces, Wintun, and SOCKS variants. That makes it a very package-nerd package: obscure in general app catalogs, but useful in reproducible network stacks and privacy, testing, mobile, or proxy-routing setups.

### Timeline

- Current README: Documents cross-platform support for Linux, Android, macOS, iOS, and Windows.
- v0.2.23 and later: README documents GitHub build provenance attestations for release artifacts.
- Current README: Documents Docker and Docker Compose sidecar-style usage.

### Related projects

- Wintun is named by the README as a Windows runtime requirement when installing from cargo.
- SOCKS4, SOCKS4a, SOCKS5, SOCKS5h, HTTP proxies, UdpGW, Docker, and GitHub artifact attestations are part of the documented operational context.
- dnsproxy is mentioned as an optional companion when direct DNS handling needs another TCP-capable resolver.

### Sources

- <https://github.com/tun2proxy/tun2proxy README: project description, supported platforms, proxy protocols, DNS modes, setup, CLI, Docker, installation, attestations.>
- <https://github.com/tun2proxy/tun2proxy/wiki: official additional documentation linked from README.>
- input source_facts.package-manager: Homebrew and Nix package coverage.


## Security Notes

No matching local secret-handling manifest was found for tun2proxy. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** tun2proxy
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - tun2proxy: normalized package name match | nixpkgs package indexes: pkgs/by-name/tu/tun2proxy/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Web development packages](https://www.automicvault.com/pkg/web-dev-tools/) - Matched web development metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [connect](https://www.automicvault.com/pkg/brew/connect/) - Shares av.db curated category or tags: cli, networking, proxy, socks, tunneling.
- [gost](https://www.automicvault.com/pkg/brew/gost/) - Shares av.db curated category or tags: cli, http-proxy, networking, proxy, socks.
- [gotun](https://www.automicvault.com/pkg/brew/gotun/) - Shares av.db curated category or tags: cli, http-proxy, networking, proxy, tunneling.
- [proxychains-ng](https://www.automicvault.com/pkg/brew/proxychains-ng/) - Shares av.db curated category or tags: cli, http-proxy, networking, proxy, socks.
- [cntlm](https://www.automicvault.com/pkg/brew/cntlm/) - Shares av.db curated category or tags: cli, networking, proxy, tunneling.
- [corkscrew](https://www.automicvault.com/pkg/brew/corkscrew/) - Shares av.db curated category or tags: cli, http-proxy, networking, proxy, tunneling.
- [dante](https://www.automicvault.com/pkg/brew/dante/) - Shares av.db curated category or tags: cli, networking, proxy, socks.
- [dsocks](https://www.automicvault.com/pkg/brew/dsocks/) - Shares av.db curated category or tags: cli, networking, proxy, socks.

## Combined YAML source

View the package source record on GitHub. [combined/tun2proxy.yml](https://github.com/automic-vault/db/blob/main/combined/tun2proxy.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
