Merge pull request #61 from passepartoutvpn/default-automatic-to-udp

Default "Automatic" protocol to UDP
This commit is contained in:
Davide De Rosa 2019-04-07 15:27:27 +02:00 committed by GitHub
commit 16093c9fb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 7 deletions

View File

@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ProtonVPN provider. [#7](https://github.com/passepartoutvpn/passepartout-ios/issues/7) - ProtonVPN provider. [#7](https://github.com/passepartoutvpn/passepartout-ios/issues/7)
- Italian translations. [#58](https://github.com/passepartoutvpn/passepartout-ios/pull/58) - Italian translations. [#58](https://github.com/passepartoutvpn/passepartout-ios/pull/58)
### Changed
- Automatic protocol defaults to UDP endpoints. [#61](https://github.com/passepartoutvpn/passepartout-ios/pull/61)
### Fixed ### Fixed
- Some providers may crash on VPN activation. [#57](https://github.com/passepartoutvpn/passepartout-ios/issues/57) - Some providers may crash on VPN activation. [#57](https://github.com/passepartoutvpn/passepartout-ios/issues/57)

View File

@ -148,8 +148,8 @@
"endpoint.sections.location_addresses.header" = "Addresses"; "endpoint.sections.location_addresses.header" = "Addresses";
"endpoint.sections.location_protocols.header" = "Protocols"; "endpoint.sections.location_protocols.header" = "Protocols";
"endpoint.cells.any_address.caption" = "Any"; "endpoint.cells.any_address.caption" = "Automatic";
"endpoint.cells.any_protocol.caption" = "Any"; "endpoint.cells.any_protocol.caption" = "Automatic";
"provider.preset.cells.tech_details.caption" = "Technical details"; "provider.preset.cells.tech_details.caption" = "Technical details";
//"provider.preset.sections.main.footer" = "Tap info button to disclose technical details."; //"provider.preset.sections.main.footer" = "Tap info button to disclose technical details.";

View File

@ -144,8 +144,8 @@
"endpoint.sections.location_addresses.header" = "Indirizzi"; "endpoint.sections.location_addresses.header" = "Indirizzi";
"endpoint.sections.location_protocols.header" = "Protocolli"; "endpoint.sections.location_protocols.header" = "Protocolli";
"endpoint.cells.any_address.caption" = "Qualunque"; "endpoint.cells.any_address.caption" = "Automatico";
"endpoint.cells.any_protocol.caption" = "Qualunque"; "endpoint.cells.any_protocol.caption" = "Automatico";
"provider.preset.cells.tech_details.caption" = "Dettagli tecnici"; "provider.preset.cells.tech_details.caption" = "Dettagli tecnici";
//"provider.preset.sections.main.footer" = "Tap info button to disclose technical details."; //"provider.preset.sections.main.footer" = "Tap info button to disclose technical details.";

View File

@ -132,7 +132,15 @@ public class ProviderConnectionProfile: ConnectionProfile, Codable, Equatable {
if let proto = manualProtocol { if let proto = manualProtocol {
builder.sessionConfiguration.endpointProtocols = [proto] builder.sessionConfiguration.endpointProtocols = [proto]
} else { } else {
builder.sessionConfiguration.endpointProtocols = preset.configuration.sessionConfiguration.endpointProtocols
// restrict "Any" protocol to UDP, unless there are no UDP endpoints
let allEndpoints = preset.configuration.sessionConfiguration.endpointProtocols
var endpoints = allEndpoints?.filter { $0.socketType == .udp }
if endpoints?.isEmpty ?? true {
endpoints = allEndpoints
}
builder.sessionConfiguration.endpointProtocols = endpoints
// builder.sessionConfiguration.endpointProtocols = [ // builder.sessionConfiguration.endpointProtocols = [
// EndpointProtocol(.udp, 8080), // EndpointProtocol(.udp, 8080),
// EndpointProtocol(.tcp, 443) // EndpointProtocol(.tcp, 443)

View File

@ -298,11 +298,11 @@ public enum L10n {
public enum Endpoint { public enum Endpoint {
public enum Cells { public enum Cells {
public enum AnyAddress { public enum AnyAddress {
/// Any /// Automatic
public static let caption = L10n.tr("Localizable", "endpoint.cells.any_address.caption") public static let caption = L10n.tr("Localizable", "endpoint.cells.any_address.caption")
} }
public enum AnyProtocol { public enum AnyProtocol {
/// Any /// Automatic
public static let caption = L10n.tr("Localizable", "endpoint.cells.any_protocol.caption") public static let caption = L10n.tr("Localizable", "endpoint.cells.any_protocol.caption")
} }
} }