Giter VIP home page Giter VIP logo

vpnmanager's Introduction

BetterVPNManager cocoapodsCarthage compatible Swift 5.0

How to get started

CocoaPods

platform :ios, '11.0'

# You need to set target when you use CocoaPods 1.0.0 or later.
target 'SampleTarget' do
  use_frameworks!
  pod 'BetterVPNManager'
end

Methods

//Import Framework
import BetterVPNManager

//Create your VPN Manager variable
let vpn = VPNManager.shared
vpn.delegate = self 

//Create your VPN Account and configurations
let vpnAccount = VPNAccount(type: VPNProtocolType.IKEv2, title: "TITLE SEEN IN SETTINGS", server: "IP HERE", account: "bd2147240ab2471d", groupName: "Group Name Of Your VPN", remoteId: "Remote IP Address(Same most of the time)", alwaysOn: true)

//Set your account password and secret
vpnAccount.passwordRef = "YourVPNPassword".data(using: .utf8)
//If you are using IPSec you can use this in order to set secret
vpnAccount.secretRef = "YourVPNSecret".data(using: .utf8)
//Note : If you want to secure you secrets and passwords for your VPN you can use some Keychain wrapper 

//Save and connect your 
vpn.saveAndConnect(account : vpnAccount)

//Only Save account then connect
vpn.save(account : vpnAccount)
vpn.connect()

//Disconnect
vpn.disconnect()

//Remove saved Account
vpn.removeProfile()

//Config On Demand (Connect only on request is made)
vpn.configOnDemand()

Delegate Methods

VPNManagerDelegate Methods:

public func VpnManagerConnectionFailed(error : VPNCollectionErrorType , localizedDescription : String)

This called when connection failed with error type and description

public func VpnManagerConnected()

This method called when connection established successfully

public func VpnManagerDisconnected()

This method called when disconnect action made successfully

public func VpnManagerProfileSaved()

This method called when you save your VPN account

public func VpnManagerProfileDeleted()

This method called when you delete your VPN account

Requirements

  • Swift 5
  • iOS 11.0 or above.

License

MIT

vpnmanager's People

Contributors

anonrig avatar barbayrak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.