Skip to content

Commit

Permalink
Add preshared key support (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzania committed Oct 9, 2023
1 parent a11893a commit c3cb6e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ impl Peer {
if let Some(endpoint) = self.endpoint {
attrs.push(WgPeerAttrs::Endpoint(endpoint));
}

if let Some(preshared_key) = &self.preshared_key {
attrs.push(WgPeerAttrs::PresharedKey(preshared_key.as_array()));
}

attrs.push(WgPeerAttrs::Flags(WGPEER_F_REPLACE_ALLOWEDIPS));
let allowed_ips = self
.allowed_ips
Expand Down

0 comments on commit c3cb6e8

Please sign in to comment.