Fix: only use Openvpn fast-io when using UDP
This commit is contained in:
@@ -30,7 +30,6 @@ func (m *Mullvad) BuildConf(connection models.OpenVPNConnection,
|
||||
"sndbuf 524288",
|
||||
"rcvbuf 524288",
|
||||
"tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA",
|
||||
"fast-io",
|
||||
"script-security 2",
|
||||
|
||||
// Added constant values
|
||||
@@ -53,6 +52,10 @@ func (m *Mullvad) BuildConf(connection models.OpenVPNConnection,
|
||||
lines = append(lines, "auth "+settings.Auth)
|
||||
}
|
||||
|
||||
if connection.Protocol == constants.UDP {
|
||||
lines = append(lines, "fast-io")
|
||||
}
|
||||
|
||||
if settings.Provider.ExtraConfigOptions.OpenVPNIPv6 {
|
||||
lines = append(lines, "tun-ipv6")
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,6 @@ func (n *Nordvpn) BuildConf(connection models.OpenVPNConnection,
|
||||
"mssfix " + strconv.Itoa(int(settings.MSSFix)),
|
||||
"reneg-sec 0",
|
||||
"comp-lzo no",
|
||||
"fast-io",
|
||||
"key-direction 1",
|
||||
"ping 15",
|
||||
"ping-restart 0",
|
||||
@@ -60,6 +59,10 @@ func (n *Nordvpn) 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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ func (s *Surfshark) BuildConf(connection models.OpenVPNConnection,
|
||||
"tun-mtu-extra 32",
|
||||
"mssfix " + strconv.Itoa(int(settings.MSSFix)),
|
||||
"reneg-sec 0",
|
||||
"fast-io",
|
||||
"key-direction 1",
|
||||
"script-security 2",
|
||||
"ping-restart 0",
|
||||
|
||||
@@ -37,7 +37,6 @@ func (t *Torguard) BuildConf(connection models.OpenVPNConnection,
|
||||
"tun-mtu-extra 32",
|
||||
"mssfix " + strconv.Itoa(int(settings.MSSFix)),
|
||||
"reneg-sec 0",
|
||||
"fast-io",
|
||||
"key-direction 1",
|
||||
"script-security 2",
|
||||
"ncp-disable",
|
||||
@@ -67,6 +66,10 @@ func (t *Torguard) BuildConf(connection models.OpenVPNConnection,
|
||||
lines = append(lines, "user "+username)
|
||||
}
|
||||
|
||||
if connection.Protocol == constants.UDP {
|
||||
lines = append(lines, "fast-io")
|
||||
}
|
||||
|
||||
lines = append(lines, utils.WrapOpenvpnCA(
|
||||
constants.TorguardCertificate)...)
|
||||
lines = append(lines, utils.WrapOpenvpnTLSAuth(
|
||||
|
||||
Reference in New Issue
Block a user