Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import NetworkExtension
- override func viewDidLoad() {
- //connect to vpn first
- let manager = NEVPNManager.shared()
- manager.loadFromPreferences { (error) -> Void in
- if manager.protocolConfiguration == nil {
- let newIPSec = NEVPNProtocolIKEv2()
- newIPSec.serverAddress = "mycompany.vpn"
- newIPSec.username = "myvpnusername"
- newIPSec.identityDataPassword = "myvpnpassword"
- newIPSec.authenticationMethod = NEVPNIKEAuthenticationMethod.none
- newIPSec.disconnectOnSleep = false
- manager.protocolConfiguration = newIPSec
- manager.isEnabled = true
- manager.saveToPreferences(completionHandler: { (error) -> Void in
- })
- }
- }
- //
- super.viewDidLoad()
- // Do any additional setup after loading the view, typically from a nib.
- let url = NSURL(string: "http://websitefromLocalhostOfMywork.php")
- let request = NSURLRequest(url:url! as URL)
- webview.loadRequest(request as URLRequest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement