Skip to content

Commit

Permalink
fix: wireguard multi peers public key parse
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Mar 28, 2024
1 parent 367a287 commit eae1f05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adapter/outbound/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ func NewWireGuard(option WireGuardOption) (*WireGuard, error) {
}

if len(option.Peers) > 0 {
for i, peer := range option.Peers {
for i := range option.Peers {
peer := &option.Peers[i] // we need modify option here
bytes, err := base64.StdEncoding.DecodeString(peer.PublicKey)
if err != nil {
return nil, E.Cause(err, "decode public key for peer ", i)
Expand Down

0 comments on commit eae1f05

Please sign in to comment.