Fix: only use Openvpn fast-io when using UDP

This commit is contained in:
Quentin McGaw
2021-05-18 23:46:20 +00:00
parent 13e75aaf20
commit a9589d8d5b
5 changed files with 16 additions and 5 deletions

View File

@@ -37,7 +37,6 @@ func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
"tun-mtu-extra 32",
"mssfix " + strconv.Itoa(int(settings.MSSFix)),
"reneg-sec 0",
"fast-io",
"key-direction 1",
"pull",
"comp-lzo no",
@@ -59,6 +58,10 @@ func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
"auth " + settings.Auth,
}
if connection.Protocol == constants.UDP {
lines = append(lines, "fast-io")
}
if !settings.Root {
lines = append(lines, "user "+username)
}