Skip to content

A scalable framework to build modern network configuration apps.

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
LICENSE.gpl
MIT
LICENSE.mit
Notifications You must be signed in to change notification settings

passepartoutvpn/partout

iOS 15+ macOS 12+ tvOS 17+ License GPLv3

Unit Tests Core

Partout

A scalable framework to build modern network configuration apps.

DISCLAIMER: the library is still undergoing deep architectural changes.

Usage

Swift

The public library supports development on these architectures:

  • macosx
  • iphonesimulator
  • appletvsimulator

Therefore, it will not build on your iOS/tvOS physical devices. If you want to use it for proprietary or commercial purposes, please contact me privately.

Import the library as a SwiftPM dependency:

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

Other languages (ABI)

The C ABI is a work in progress and for private use, as the vendors/core submodule is currently a private repository.

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. Bear in mind that the generated library will still need to be bundled with the proper Swift runtime.

Build

First, fetch all the vendored submodules:

git submodule init
git submodule update --recursive

Then, you will 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:

  • -l: Build Partout as dynamic library (opt-in)
  • -config (Debug|Release): The CMake build type
  • -crypto (openssl|native): The crypto subsystem to pick between OpenSSL and Native/MbedTLS
  • -wireguard: Enable support for WireGuard (requires Go)

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

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

Sample output:

.bin/partout.h                       # The Partout ABI
.bin/darwin-arm64/libPartout.dylib   # macOS
.bin/linux-aarch64/libPartout.so     # Linux
.bin/windows-arm64/Partout.dll       # Windows

This should work for all platforms, except for Android, which asks for a hybrid CMake + SwiftPM approach.

Build for Android

Building for Android requires access to the Swift Android SDK, and this is not straightforward from CMake. That's why the scripts/build-android.sh script does the heavy-lifting in two steps:

  • Cross-compile the vendored static libraries with CMake for Android
  • Embed the static libraries in SwiftPM to generate a dynamic library with the Swift Android SDK

Requirements:

  • Set $ANDROID_NDK_ROOT to point to your Android NDK installation
  • Add the NDK toolchain to the $PATH

The script runs on macOS, but can be adapted for other platforms with slight tweaks to scripts/build.sh. The Android output is consistent with the other platforms:

.bin/partout.h
.bin/android-arm64/libPartout.so

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) 2025 Davide De Rosa. All rights reserved.

The core package is distributed as a binary framework in GitHub Releases and is licensed under the MIT.

Anything else is licensed under the GPLv3.

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

OpenVPN

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

WireGuard

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

Contacts

Twitter: @keeshux

Website: passepartoutvpn.app