Update Demo code

This commit is contained in:
Davide De Rosa 2018-10-25 20:40:22 +02:00
parent 917427fc0c
commit 2abb0b5dfc
3 changed files with 20 additions and 17 deletions

View File

@ -88,15 +88,16 @@ extension ViewController {
let port = UInt16(textPort.text!)!
let credentials = SessionProxy.Credentials(textUsername.text!, textPassword.text!)
var builder = TunnelKitProvider.ConfigurationBuilder(ca: ca)
var sessionBuilder = SessionProxy.ConfigurationBuilder(ca: ca)
sessionBuilder.cipher = .aes256gcm
sessionBuilder.digest = .sha1
sessionBuilder.compressionFraming = .compLZO
sessionBuilder.renegotiatesAfter = nil
sessionBuilder.usesPIAPatches = true
var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
let socketType: TunnelKitProvider.SocketType = switchTCP.isOn ? .tcp : .udp
builder.endpointProtocols = [TunnelKitProvider.EndpointProtocol(socketType, port)]
builder.cipher = .aes256gcm
builder.digest = .sha1
builder.mtu = 1350
builder.compressionFraming = .compLZO
builder.renegotiatesAfterSeconds = nil
builder.usesPIAPatches = true
builder.shouldDebug = true
builder.debugLogKey = "Log"

View File

@ -88,15 +88,17 @@ extension ViewController {
let port = UInt16(textPort.stringValue)!
let credentials = SessionProxy.Credentials(textUsername.stringValue, textPassword.stringValue)
var builder = TunnelKitProvider.ConfigurationBuilder(ca: ca)
var sessionBuilder = SessionProxy.ConfigurationBuilder(ca: ca)
sessionBuilder.cipher = .aes128cbc
sessionBuilder.digest = .sha1
sessionBuilder.compressionFraming = .compLZO
sessionBuilder.renegotiatesAfter = nil
sessionBuilder.usesPIAPatches = true
var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
// let socketType: TunnelKitProvider.SocketType = isTCP ? .tcp : .udp
let socketType: TunnelKitProvider.SocketType = .udp
builder.endpointProtocols = [TunnelKitProvider.EndpointProtocol(socketType, port)]
builder.cipher = .aes128cbc
builder.digest = .sha1
builder.mtu = 1350
builder.compressionFraming = .compLZO
builder.renegotiatesAfterSeconds = nil
builder.shouldDebug = true
builder.debugLogKey = "Log"

View File

@ -1,13 +1,13 @@
PODS:
- OpenSSL-Apple (1.1.0i-v2)
- SwiftyBeaver (1.6.1)
- TunnelKit (1.2.2):
- TunnelKit/AppExtension (= 1.2.2)
- TunnelKit/Core (= 1.2.2)
- TunnelKit/AppExtension (1.2.2):
- TunnelKit (1.3.0):
- TunnelKit/AppExtension (= 1.3.0)
- TunnelKit/Core (= 1.3.0)
- TunnelKit/AppExtension (1.3.0):
- SwiftyBeaver
- TunnelKit/Core
- TunnelKit/Core (1.2.2):
- TunnelKit/Core (1.3.0):
- OpenSSL-Apple (~> 1.1.0h)
- SwiftyBeaver
@ -26,7 +26,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
OpenSSL-Apple: a93b8f2eec8783ff40d9a9304de180ab68bb647c
SwiftyBeaver: ccfcdf85a04d429f1633f668650b0ce8020bda3a
TunnelKit: 15c88f0cef7b926883566a9455e912a1e55f4048
TunnelKit: 8e747cac28959ebfdfa4eeab589c933f1856c0fb
PODFILE CHECKSUM: f66dfaaa92a8d04ab2743f3caeab0ac9f9f25859