cloudflare / cloudflare/boringtun

API Improvements - Expose peer API, allow custom packet producer/consumer

Open
#261 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
7.2k
Forks
532
PR merge metrics
No merged PRs in 30d

Description

Hi all, I love this project as a drop-in replacement for kernel WireGuard, but the library API could use some fleshing out to broaden the usability of this crate as a library. Here are some features I'd love to see added:

1) Documentation! Thought I'd start here before actual features since it really hampers usability to have the entire crate undocumented. Examples would go a long way too.

2) Public API for querying and manipulating peers that were added over the sock API rather than through the library. Currently there is no access to this whatsoever, which means a library based on boringtun which expects to be configured by `wg` has absolutely zero access or control over anything - all you can do is drive the event loop and wait.

3) Internal processing of packets. This is the big one for me - the entire reason I was attracted to wireguard-as-a-library as this crate provides is so I could avoid the need for the `tun` interface to send and receive packets through WireGuard, and instead do this directly from my application without getting the kernel involved. This could maybe be done using a trait for a generic producer/consumer of IP packets so that it could be configured to use tun by default, but also let a library user of this crate implement their own drop-in replacement.

Thank you for putting together this project, it's a great addition to the Rust ecosystem and the library half of this project has a lot of potential to allow for very flexible custom behavior using the WG protocol.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.