mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-05 13:37:30 +00:00
fix: wireguard multi peers public key parse
This commit is contained in:
@@ -188,7 +188,8 @@ func NewWireGuard(option WireGuardOption) (*WireGuard, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(option.Peers) > 0 {
|
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)
|
bytes, err := base64.StdEncoding.DecodeString(peer.PublicKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, E.Cause(err, "decode public key for peer ", i)
|
return nil, E.Cause(err, "decode public key for peer ", i)
|
||||||
|
|||||||
Reference in New Issue
Block a user