{"id":13436243,"url":"https://github.com/cloudflare/boringtun","last_synced_at":"2025-05-12T03:45:53.053Z","repository":{"id":37593742,"uuid":"152798409","full_name":"cloudflare/boringtun","owner":"cloudflare","description":"Userspace WireGuard® Implementation in Rust","archived":false,"fork":false,"pushed_at":"2025-04-28T06:26:20.000Z","size":1027,"stargazers_count":6361,"open_issues_count":102,"forks_count":438,"subscribers_count":74,"default_branch":"master","last_synced_at":"2025-05-01T13:52:19.100Z","etag":null,"topics":["cloudflare","rust","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudflare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-12T19:27:06.000Z","updated_at":"2025-04-30T02:03:11.000Z","dependencies_parsed_at":"2024-04-29T06:45:23.895Z","dependency_job_id":"f211fba8-e04f-41b8-81d3-c7529759c418","html_url":"https://github.com/cloudflare/boringtun","commit_stats":{"total_commits":150,"total_committers":47,"mean_commits":"3.1914893617021276","dds":0.84,"last_synced_commit":"be08af94a76135df209bbbb93492a6bc1e1f769f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fboringtun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fboringtun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fboringtun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fboringtun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudflare","download_url":"https://codeload.github.com/cloudflare/boringtun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253671745,"owners_count":21945466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","rust","wireguard"],"created_at":"2024-07-31T03:00:45.818Z","updated_at":"2025-05-12T03:45:53.024Z","avatar_url":"https://github.com/cloudflare.png","language":"Rust","readme":"![boringtun logo banner](./banner.png)\n\n# BoringTun\n\n## Warning\nBoringtun is currently undergoing a restructuring. You should probably not rely on or link to \nthe master branch right now. Instead you should use the crates.io page.\n\n- boringtun: [![crates.io](https://img.shields.io/crates/v/boringtun.svg)](https://crates.io/crates/boringtun)\n- boringtun-cli [![crates.io](https://img.shields.io/crates/v/boringtun-cli.svg)](https://crates.io/crates/boringtun-cli)\n\n**BoringTun** is an implementation of the [WireGuard\u003csup\u003e®\u003c/sup\u003e](https://www.wireguard.com/) protocol designed for portability and speed.\n\n**BoringTun** is successfully deployed on millions of [iOS](https://apps.apple.com/us/app/1-1-1-1-faster-internet/id1423538627) and [Android](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone\u0026hl=en_US) consumer devices as well as thousands of Cloudflare Linux servers. \n\nThe project consists of two parts:\n\n* The executable `boringtun-cli`, a [userspace WireGuard](https://www.wireguard.com/xplatform/) \n  implementation for Linux and macOS.\n* The library `boringtun` that can be used to implement fast and efficient WireGuard client apps on various platforms, including iOS and Android. It implements the underlying WireGuard protocol, without the network or tunnel stacks, those can be implemented in a platform idiomatic way.\n\n### Installation\n\nYou can install this project using `cargo`:\n\n```\ncargo install boringtun-cli\n```\n\n### Building\n\n- Library only: `cargo build --lib --no-default-features --release [--target $(TARGET_TRIPLE)]`\n- Executable: `cargo build --bin boringtun-cli --release [--target $(TARGET_TRIPLE)]`\n\nBy default the executable is placed in the `./target/release` folder. You can copy it to a desired location manually, or install it using `cargo install --bin boringtun --path .`.\n\n### Running\n\nAs per the specification, to start a tunnel use:\n\n`boringtun-cli [-f/--foreground] INTERFACE-NAME`\n\nThe tunnel can then be configured using [wg](https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8), as a regular WireGuard tunnel, or any other tool.\n\nIt is also possible to use with [wg-quick](https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8) by setting the environment variable `WG_QUICK_USERSPACE_IMPLEMENTATION` to `boringtun`. For example:\n\n`sudo WG_QUICK_USERSPACE_IMPLEMENTATION=boringtun-cli WG_SUDO=1 wg-quick up CONFIGURATION`\n\n### Testing\n\nTesting this project has a few requirements:\n\n- `sudo`: required to create tunnels. When you run `cargo test` you'll be prompted for your password.\n- Docker: you can install it [here](https://www.docker.com/get-started). If you are on Ubuntu/Debian you can run `apt-get install docker.io`.\n\n## Supported platforms\n\nTarget triple                 |Binary|Library|\n------------------------------|:----:|------|\nx86_64-unknown-linux-gnu      |  ✓   | ✓    |\naarch64-unknown-linux-gnu     |  ✓   | ✓    |\narmv7-unknown-linux-gnueabihf |  ✓   | ✓    |\nx86_64-apple-darwin           |  ✓   | ✓    |\nx86_64-pc-windows-msvc        |      | ✓    |\naarch64-apple-ios             |      | ✓    |\narmv7-apple-ios               |      | ✓    |\narmv7s-apple-ios              |      | ✓    |\naarch64-linux-android         |      | ✓    |\narm-linux-androideabi         |      | ✓    |\n\n\u003csub\u003eOther platforms may be added in the future\u003c/sub\u003e\n\n#### Linux\n\n`x86-64`, `aarch64` and `armv7` architectures are supported. The behaviour should be identical to that of [wireguard-go](https://git.zx2c4.com/wireguard-go/about/), with the following difference:\n\n`boringtun` will drop privileges when started. When privileges are dropped it is not possible to set `fwmark`. If `fwmark` is required, such as when using `wg-quick`, run with `--disable-drop-privileges` or set the environment variable `WG_SUDO=1`.\n\nYou will need to give the executable the `CAP_NET_ADMIN` capability using: `sudo setcap cap_net_admin+epi boringtun`. sudo is not needed.\n\n#### macOS\n\nThe behaviour is similar to that of [wireguard-go](https://git.zx2c4.com/wireguard-go/about/). Specifically the interface name must be `utun[0-9]+` for an explicit interface name or `utun` to have the kernel select the lowest available. If you choose `utun` as the interface name, and the environment variable `WG_TUN_NAME_FILE` is defined, then the actual name of the interface chosen by the kernel is written to the file specified by that variable.\n\n---\n\n#### FFI bindings\n\nThe library exposes a set of C ABI bindings, those are defined in the `wireguard_ffi.h` header file. The C bindings can be used with C/C++, Swift (using a bridging header) or C# (using [DLLImport](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute?view=netcore-2.2) with [CallingConvention](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention?view=netcore-2.2) set to `Cdecl`).\n\n#### JNI bindings\n\nThe library exposes a set of Java Native Interface bindings, those are defined in `src/jni.rs`.\n\n## License\n\nThe project is licensed under the [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause).\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the 3-Clause BSD License, shall be licensed as above, without any additional terms or conditions.\n\nIf you want to contribute to this project, please read our [`CONTRIBUTING.md`].\n\n[`CONTRIBUTING.md`]: https://github.com/cloudflare/.github/blob/master/CONTRIBUTING.md\n\n---\n\u003csub\u003e\u003csub\u003e\u003csub\u003e\u003csub\u003eWireGuard is a registered trademark of Jason A. Donenfeld. BoringTun is not sponsored or endorsed by Jason A. Donenfeld.\u003c/sub\u003e\u003c/sub\u003e\u003c/sub\u003e\u003c/sub\u003e\n","funding_links":[],"categories":["应用","Applications","Install from Source","Web and Cloud Security","Rust","应用程序 Applications","应用程序","应用 Applications","rust","网络服务","Security","Projects","Networking \u0026 Performance"],"sub_categories":["WireGuard Tools","Cloud and Infrastructure","贡献","网络服务_其他","Programming Languages","Alternative Implementations","Protocol Implementations"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fboringtun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudflare%2Fboringtun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fboringtun/lists"}