Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
liberty
tunnel
liberty-tunnel-client-library-apple
Commits
e9143d94
Commit
e9143d94
authored
Jun 30, 2018
by
Davide De Rosa
Browse files
Add fallback IPv4 address to PIATunnelProfile
When available.
parent
a068202a
Changes
1
Hide whitespace changes
Inline
Side-by-side
PIALibrary/Sources/VPN/PIATunnelProfile.swift
View file @
e9143d94
...
...
@@ -172,7 +172,17 @@ public class PIATunnelProfile: NetworkExtensionProfile {
let
port
=
configuration
.
port
??
PIATunnelProfile
.
defaultPort
cfg
.
serverAddress
=
"
\(
configuration
.
server
.
hostname
)
:
\(
port
)
"
cfg
.
providerBundleIdentifier
=
bundleIdentifier
cfg
.
providerConfiguration
=
configuration
.
customConfiguration
?
.
serialized
()
var
customCfg
=
configuration
.
customConfiguration
if
let
piaCfg
=
customCfg
as?
PIATunnelProvider
.
Configuration
,
let
bestAddress
=
configuration
.
server
.
bestOpenVPNAddressForUDP
?
.
hostname
{
// XXX: UDP address = TCP address
var
builder
=
piaCfg
.
builder
()
builder
.
resolvedAddresses
=
[
bestAddress
]
customCfg
=
builder
.
build
()
}
cfg
.
providerConfiguration
=
customCfg
?
.
serialized
()
return
cfg
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment