mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-18 22:49:10 +00:00
Default "Any" protocol to UDP endpoints
Mitigates a potential issue with randomizeEndpoint where TCP endpoints might be picked with equal probability, resulting in poor performance out of the box. Let the user pick TCP endpoints manually.
This commit is contained in:
parent
b4c3b57d38
commit
f53ad65bcd
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user