Partout

July 2, 2026 · View on GitHub

iOS 16+ macOS 13+ tvOS 17+ License GPLv3

Unit Tests Release

Partout

The easiest way to build cross-platform tunnel apps.

Partout (French: /paʁtu/) is a multilanguage library using Swift and C at its core. It provides VPN functionality through the Network Extension framework on Apple platforms, but it partially works on Android, Linux, and Windows (with Wintun). I'm documenting the long journey of making Partout fully cross-platform in a blog series, where I write about the challenges of Swift on non-Apple targets, and how I'm overcoming them.

Partout is the backbone of Passepartout. The footprint is kept in check on non-Apple platforms by reimplementing a small subset of Swift Foundation in the MiniFoundation targets.

Usage

As per the GPL, the public license is not suitable for the App Store and other closed-source distributions. If you want to use Partout for proprietary or commercial purposes, please obtain a proper license.

SwiftPM

Import the library as a SwiftPM dependency:

dependencies: [
    .package(url: "https://github.com/partout-io/partout", branch: "master")
],
targets: [
    .target(
        name: "MyTarget",
        dependencies: ["partout"]
    )
]

CMake

Partout can be imported as a CMake project. The exported target is partout.

Requirements

  • Swift
  • C/C++ build tools
  • CMake
  • ninja
  • Android NDK (optional)
  • Swift Android SDK (optional)

These are the requirements for Partout, but additional build tools may be required depending on the vendors build system.

Build

Use one of the scripts/build.* variants based on the host platform:

  • scripts/build.sh (bash)
  • scripts/build.ps1 (Windows PowerShell)

The script builds the vendors as static libraries and accepts a few options:

  • -gen: Generate CMake metadata
  • -config (Debug|Release): The CMake build type (build.sh only)
  • -l: Build the Partout library (opt-in)
  • -crypto (openssl|native[,openssl|native...]): Pick one or more crypto subsystems between OpenSSL and Native/MbedTLS
  • -wireguard: Enable support for WireGuard (requires Go)
  • -android: Build for Android
  • -vendors [bundled|<url>]: Build bundled vendors (requires submodules), or provide the prebuilt vendor URL for Android/Windows

For example, this will build Partout for release with a dependency on OpenSSL:

$ scripts/build.sh -gen -config Release -l -crypto openssl

Sample output:

# macOS
bin/darwin-arm64/libpartout.dylib	
# Linux
bin/linux-aarch64/libpartout.so
# Android
bin/android-aarch64/libpartout.so
# Windows
bin/windows-arm64/partout.dll

Partout must be bundled with the shared vendored libraries to work. On Windows, it must also include the Swift runtime DLLs. Building for Android requires access to the Android NDK and the Swift Android SDK.

Check out scripts/build.sh and scripts/build.ps1 for more details.

Demo

Xcode

There is an Xcode Demo in the Examples directory. Edit Demo/Config.xcconfig with your developer details. You must comply with all the capabilities and entitlements in the main app and the tunnel extension target.

Put your configuration files into Demo/App/Files with these names:

  • OpenVPN configuration: test-sample.ovpn
  • OpenVPN credentials (in two lines): test-sample.txt
  • WireGuard configuration: test-sample.wg

Open Demo.xcodeproj and run the PartoutDemo target.

License

Copyright (c) 2026 Davide De Rosa. All rights reserved.

The library is licensed under the GPLv3. The MiniFoundation targets and the CMake toolchains are MIT-licensed.

Contributing

By contributing to this project you are agreeing to the terms stated in the Contributor License Agreement (CLA). For more details please see CONTRIBUTING.

Credits

Libraries:

Special contributors:

OpenSSL

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)

OpenVPN

© Copyright 2026 OpenVPN | OpenVPN is a registered trademark of OpenVPN, Inc.

WireGuard

© Copyright 2015-2026 Jason A. Donenfeld. All Rights Reserved. "WireGuard" and the "WireGuard" logo are registered trademarks of Jason A. Donenfeld.

Contacts

Twitter: @keeshux

Website: partout.io