Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Termux WireProxy

A lightweight WireGuard-over-SOCKS5 management wrapper for Termux.

Termux WireProxy provides a simple command-line interface (twp) for managing a WireProxy-based VPN SOCKS5 proxy connection on Android using Termux.

The goal of this project is to make WireProxy easier to install, configure, start, stop, monitor, and troubleshoot from a mobile Linux environment.


Features

  • Simple twp command interface
  • Automatic WireProxy dependency installation
  • Provider/profile management
  • Start, stop, and restart WireProxy
  • Process and connection health checks
  • Active configuration display
  • VPN exit IP verification
  • Log viewing and follow mode
  • Version reporting
  • Separation of public project files and private VPN credentials

Requirements

Before installing, you need:

  • Android device
  • Termux
  • A WireGuard-compatible VPN configuration file

Termux WireProxy uses:

  • WireProxy to create a local SOCKS5 proxy from a WireGuard connection.
  • WireGuard configuration files provided by your VPN provider or your own WireGuard server.

Your WireGuard configuration file contains private information such as cryptographic keys and should never be shared publicly.


Installation

1. Clone the repository

Install Git if needed:

pkg install git

Clone the project:

git clone https://github.com/UnB21/termux-wireproxy.git

Enter the project directory you just cloned:

cd termux-wireproxy

If you cloned the repository using a different directory name, enter that directory instead.

Example:

cd termux-wireproxy-test

You can verify your current working directory at any time by running:

pwd

Example output:

/data/data/com.termux/files/home/<your-project-directory>

2. Run the installer

Run:

./install.sh

The installer will:

  • Verify it is running inside Termux
  • Install WireProxy if it is missing
  • Make the twp command executable
  • Create the Termux command shortcut

After installation, verify:

twp version

Expected output:

Termux WireProxy
Version: 0.1.0-alpha

Run diagnostics:

twp doctor

Understanding the Project Layout

After installation, all project files are stored inside the directory you cloned.

To see the project files, run:

ls

You should see folders similar to:

bin
configs
lib
logs
providers
scripts
state

The most important directories are:

Directory Purpose
providers/ Stores your private WireGuard configuration files
configs/ Project configuration files
scripts/ Internal scripts used by the twp command
logs/ WireProxy log files
state/ Runtime state information

All commands shown throughout this guide should be run from inside the project directory unless stated otherwise.

First-Time Configuration

Termux WireProxy uses provider profiles.

A provider profile is a WireGuard configuration file stored inside the providers directory.

The expected layout is:

providers/
└── provider-name/
    └── profile-name.conf

Example:

providers/
└── proton/
    └── us.conf

Adding a WireGuard Profile

A WireGuard profile is a configuration file supplied by your VPN provider or generated for your own WireGuard server.

The file usually has a .conf extension and contains information such as:

  • Interface private key
  • VPN address
  • Server public key
  • Server endpoint
  • Allowed IP addresses

Example filename:

us.conf

Create a directory for your VPN provider:

mkdir -p providers/proton

Verify that the directory was created:

ls providers

Expected output:

proton

At this point, the provider directory exists but is empty.

Your WireGuard configuration file must be copied into that directory before it can be used.

Never upload your WireGuard configuration file to GitHub or share it publicly.

Your WireGuard profile contains private cryptographic keys and should be treated like a password.


Getting a WireGuard Configuration File

Termux WireProxy requires a WireGuard client configuration file that connects to an existing WireGuard server.

There are two common ways to obtain one.


Option 1: Use a VPN Provider (Recommended)

Many VPN providers allow downloading WireGuard configuration files from their account dashboard.

This is the easiest option because the provider already operates the WireGuard server.


Option 2: Create Your Own WireGuard Server

If you want to host your own VPN server, you can generate WireGuard configurations using tools such as:

These tools generate server and client configuration files.

You will still need:

  • A VPS or server
  • A public IP address
  • A WireGuard server installation

A configuration generator does not create a VPN service by itself.

After generating your client configuration file, place it in:

providers/<provider>/<profile>.conf

Example:

providers/myserver/home.conf

Then activate it:

twp use myserver home.conf

Prefer tools that generate private keys locally and do not transmit private keys to third parties. Review the privacy information of any generator before trusting it with cryptographic material.


Copying Your WireGuard Configuration into Termux

If you downloaded your WireGuard configuration using your Android web browser, it is usually saved in your Downloads folder.

To allow Termux to access Android storage, run:

termux-setup-storage

When prompted, grant the requested storage permission.

Your Downloads folder will then be available at:

~/storage/downloads

List the downloaded files:

ls ~/storage/downloads

If your configuration file is named us.conf, copy it into your provider directory:

cp ~/storage/downloads/us.conf providers/proton/

Verify that it was copied successfully:

ls providers/proton

Expected output:

us.conf

Your WireGuard configuration is now ready to be selected by Termux WireProxy.


Available Providers

List available provider profiles:

twp providers

Selecting a Provider Profile

The twp use command expects two arguments:

twp use <provider> <profile>
  • <provider> is the name of the directory inside providers/
  • <profile> is the name of the WireGuard configuration file

For example, if your project looks like this:

providers/
└── proton/
    └── us.conf

Run:

twp use proton us.conf

Another example:

providers/
└── myserver/
    └── home.conf

Run:

twp use myserver home.conf

After selecting a profile, verify the active configuration:

twp current

Quick Start Example

The following example demonstrates a complete first-time setup after installation.

Create a provider directory:

mkdir -p providers/myvpn

Copy your WireGuard configuration file into that directory:

providers/myvpn/home.conf

Select the profile:

twp use myvpn home.conf

Verify the active configuration:

twp current

Run diagnostics:

twp doctor

Start WireProxy:

twp start

Check that WireProxy is running:

twp status

Verify your VPN exit IP:

twp ip

If everything is configured correctly, your public IP address should now be the IP address of your VPN server or VPN provider.


Testing the Connection

Run:

twp health

This checks:

  • WireProxy availability
  • Configuration validity
  • Running process
  • SOCKS5 availability

To check your VPN exit IP:

twp ip

Commands

The twp command manages WireProxy without requiring you to manually run WireProxy commands.

Start WireProxy

twp start

Stop WireProxy

twp stop

Restart WireProxy

twp restart

Check Status

twp status

Health Check

twp health

Diagnose Problems

twp doctor

Show Current Configuration

twp current

Show VPN Exit IP

twp ip

View Logs

twp logs

Follow logs:

twp logs -f

List Providers

twp providers

Change Provider Profile

twp use <provider> <profile>

Example:

twp use proton us.conf

Show Version

twp version

Troubleshooting

twp: command not found

Run the installer again:

./install.sh

Then verify:

twp version

WireProxy is missing

Run:

./install.sh

The installer will install WireProxy automatically.

You can also verify manually:

wireproxy --version

Provider profile missing

This usually means Termux WireProxy could not find the WireGuard configuration file it expects.

First, list your provider directories:

ls providers

Then list the profiles inside your provider directory:

ls providers/proton

Verify the currently selected configuration:

twp current

If you selected the wrong provider or profile, activate the correct one:

twp use <provider> <profile>

Example:

twp use proton us.conf

WireProxy will not start

Run:

twp doctor

Then check logs:

twp logs

Restart if needed:

twp restart

SOCKS5 proxy unavailable

If twp doctor reports that SOCKS5 is unavailable:

Check status:

twp status

Review logs:

twp logs

Restart WireProxy:

twp restart

Security

Private files are intentionally excluded from Git tracking.

Ignored files include:

providers/**/*.conf
logs/
state/

Never upload:

  • WireGuard configuration files
  • Private keys
  • VPN credentials

Treat your WireGuard profile the same way you would treat a password.


Project Status

Current version:

0.1.0-alpha

This project is actively under development.


License

This project is licensed under the MIT License.

See the LICENSE file for details.

About

A lightweight Termux wrapper for managing Wireproxy-based WireGuard SOCKS5 VPN connections on Android.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages