Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. override func viewDidLoad() {
  2. //connect to vpn first
  3. let manager = NEVPNManager.shared()
  4. manager.loadFromPreferences { (error) -> Void in
  5. if manager.protocolConfiguration == nil {
  6. let newIPSec = NEVPNProtocolIKEv2()
  7. newIPSec.serverAddress = "mycompany.vpn"
  8. newIPSec.username = "myvpnusername"
  9. newIPSec.identityDataPassword = "myvpnpassword"
  10. newIPSec.authenticationMethod = NEVPNIKEAuthenticationMethod.none
  11. newIPSec.disconnectOnSleep = false
  12.  
  13. manager.protocolConfiguration = newIPSec
  14. manager.isEnabled = true
  15.  
  16. manager.saveToPreferences(completionHandler: { (error) -> Void in
  17.  
  18. })
  19. }
  20. }
  21. //
  22.  
  23. super.viewDidLoad()
  24. // Do any additional setup after loading the view, typically from a nib.
  25.  
  26. let url = NSURL(string: "http://websitefromLocalhostOfMywork.php")
  27. let request = NSURLRequest(url:url! as URL)
  28. webview.loadRequest(request as URLRequest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement