SHARE
TWEET

Untitled

a guest Dec 6th, 2016 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top