Warning
This repository is no longer being maintained. The tun2socks source is now maintained in the outline-apps repository and Intra repository.
Go package for building go-tun2socks-based clients for Outline and Intra (now with support for Choir metrics). For macOS, iOS, and Android, the output is a library; for Linux and Windows it is a command-line executable.
- macOS host (iOS, macOS)
- make
- Go >= 1.18
- A C compiler (e.g.: clang, gcc)
- sdkmanager
- Download the command line tools from https://developer.android.com/studio.
- Unzip the pacakge as
~/Android/Sdk/cmdline-tools/latest/
. Make suresdkmanager
is located at~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager
- Android NDK 23
- Install the NDK with
~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-30" "ndk;23.1.7779620"
(platform from outline-client, exact NDK 23 version obtained fromsdkmanager --list
) - Set up the environment variables:
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/23.1.7779620 ANDROID_HOME=~/Android/Sdk
- Install the NDK with
- gomobile (installed as needed by
make
)
make clean && make android
This will create build/android/{tun2socks.aar,tun2socks-sources.jar}
If needed, you can extract the jni files into build/android/jni
with:
unzip build/android/tun2socks.aar 'jni/*' -d build/android
- Xcode
- gomobile (installed as needed by
make
)
make clean && make apple
This will create build/apple/Tun2socks.xcframework
.
We build binaries for Linux and Windows from source without any custom integrations. xgo
and Docker are required to support cross-compilation.
- Docker (for xgo)
- xgo (installed as needed by
make
) - ghcr.io/crazy-max/xgo Docker image. This is pulled automatically by xgo and takes ~6.8 GB of disk space.
For Linux:
make clean && make linux
This will create build/linux/tun2socks
.
For Windows:
make clean && make windows
This will create build/windows/tun2socks.exe
.
Same set up as for the Outline Android library.
Build with:
make clean && make intra
This will create build/intra/{tun2socks.aar,tun2socks-sources.jar}