Update demo accordingly

This commit is contained in:
Davide De Rosa 2018-09-07 00:32:16 +02:00
parent 7aa4a0cc04
commit a1cd6de860
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ extension ViewController {
password: password password: password
) )
var builder = TunnelKitProvider.ConfigurationBuilder(appGroup: ViewController.appGroup) var builder = TunnelKitProvider.ConfigurationBuilder()
let socketType: TunnelKitProvider.SocketType = switchTCP.isOn ? .tcp : .udp let socketType: TunnelKitProvider.SocketType = switchTCP.isOn ? .tcp : .udp
builder.endpointProtocols = [TunnelKitProvider.EndpointProtocol(socketType, port)] builder.endpointProtocols = [TunnelKitProvider.EndpointProtocol(socketType, port)]
builder.cipher = .aes128cbc builder.cipher = .aes128cbc
@ -44,6 +44,7 @@ extension ViewController {
let configuration = builder.build() let configuration = builder.build()
return try! configuration.generatedTunnelProtocol( return try! configuration.generatedTunnelProtocol(
withBundleIdentifier: ViewController.bundleIdentifier, withBundleIdentifier: ViewController.bundleIdentifier,
appGroup: ViewController.appGroup,
endpoint: endpoint endpoint: endpoint
) )
} }

View File

@ -30,7 +30,7 @@ extension ViewController {
password: password password: password
) )
var builder = TunnelKitProvider.ConfigurationBuilder(appGroup: ViewController.appGroup) var builder = TunnelKitProvider.ConfigurationBuilder()
// let socketType: TunnelKitProvider.SocketType = isTCP ? .tcp : .udp // let socketType: TunnelKitProvider.SocketType = isTCP ? .tcp : .udp
let socketType: TunnelKitProvider.SocketType = .udp let socketType: TunnelKitProvider.SocketType = .udp
builder.endpointProtocols = [TunnelKitProvider.EndpointProtocol(socketType, port)] builder.endpointProtocols = [TunnelKitProvider.EndpointProtocol(socketType, port)]
@ -45,6 +45,7 @@ extension ViewController {
let configuration = builder.build() let configuration = builder.build()
return try! configuration.generatedTunnelProtocol( return try! configuration.generatedTunnelProtocol(
withBundleIdentifier: ViewController.bundleIdentifier, withBundleIdentifier: ViewController.bundleIdentifier,
appGroup: ViewController.appGroup,
endpoint: endpoint endpoint: endpoint
) )
} }