mirror of
https://github.com/h44z/wg-portal
synced 2025-02-26 05:49:14 +00:00
remove endpoint from peer in server-mode
This commit is contained in:
parent
2ca1226d50
commit
46dc6dc2ad
@ -125,7 +125,7 @@ func (p Peer) GetAllowedIPs() []string {
|
||||
return common.ParseStringList(p.AllowedIPsStr)
|
||||
}
|
||||
|
||||
func (p Peer) GetConfig(_ *Device) wgtypes.PeerConfig {
|
||||
func (p Peer) GetConfig(dev *Device) wgtypes.PeerConfig {
|
||||
publicKey, _ := wgtypes.ParseKey(p.PublicKey)
|
||||
|
||||
var presharedKey *wgtypes.Key
|
||||
@ -135,7 +135,7 @@ func (p Peer) GetConfig(_ *Device) wgtypes.PeerConfig {
|
||||
}
|
||||
|
||||
var endpoint *net.UDPAddr
|
||||
if p.Endpoint != "" {
|
||||
if p.Endpoint != "" && dev.Type == DeviceTypeClient {
|
||||
addr, err := net.ResolveUDPAddr("udp", p.Endpoint)
|
||||
if err == nil {
|
||||
endpoint = addr
|
||||
|
Loading…
Reference in New Issue
Block a user