mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-23 00:15:19 +03:00
Make MTU and PersistentKeepalive optional (#123)
This commit is contained in:
parent
3c1d894b44
commit
2d9eeb08e8
4 changed files with 50 additions and 20 deletions
|
@ -41,12 +41,15 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
if n, err := strconv.Atoi(split[1]); err == nil {
|
||||
desiredPort = n
|
||||
} else {
|
||||
log.Error("Endpoint appears to be incorrectly formated: ", err)
|
||||
log.Error("Endpoint appears to be incorrectly formatted: ", err)
|
||||
}
|
||||
}
|
||||
peerEndpoint := fmt.Sprintf("Endpoint = %s:%d", desiredHost, desiredPort)
|
||||
|
||||
peerPersistentKeepalive := fmt.Sprintf("PersistentKeepalive = %d", setting.PersistentKeepalive)
|
||||
peerPersistentKeepalive := ""
|
||||
if setting.PersistentKeepalive > 0 {
|
||||
peerPersistentKeepalive = fmt.Sprintf("PersistentKeepalive = %d", setting.PersistentKeepalive)
|
||||
}
|
||||
|
||||
// build the config as string
|
||||
strConfig := "[Interface]\n" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue