NEPacketTunnelVPNDemo | iOS VPN client implementation demo based on iOS9 | iOS library
kandi X-RAY | NEPacketTunnelVPNDemo Summary
kandi X-RAY | NEPacketTunnelVPNDemo Summary
Apple released a new version of Network Extension since iOS9, which allows us to implement our own VPN protocol. This repo provides a simple demo using Network Extension with Swift 3.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NEPacketTunnelVPNDemo
NEPacketTunnelVPNDemo Key Features
NEPacketTunnelVPNDemo Examples and Code Snippets
Community Discussions
Trending Discussions on NEPacketTunnelVPNDemo
QUESTION
I own a vpn app. Our app comes predefined with one server, this server is hard coded into the app. It looks like this; let serverAddress = "0.0.0.0"
(but with a real server ip).
I have made a picker view using the following:
let IPs = ["GER1", "UK1", "GER2", "UK2"]
I now want to know how to say " GER1=192.168.1.2
UK1=192.168.1.3
GER2=192.168.1.4
UK2=192.168.1.5
"
and then parse it to let serverAddress = "0.0.0.0"
replacing 0.0.0.0
with the selected ip.
In summary:
I only have 1 server specified, If I ever wanted to change it I'd change the let serverAddress = "0.0.0.0"
but I would like to add more servers as an option. so I somehow need to change 0.0.0.0
I personally think picker view is the best way of doing it. But I am open to ideas.
The source code I am working with is here: https://github.com/lxdcn/NEPacketTunnelVPNDemo
...ANSWER
Answered 2018-Oct-22 at 18:04First off, you should change the serverAddress
to a var
instead of a let
.
Then, you should use the delegate function: didSelectRow
, to change serverAddress
to which server address that was selected.
To achieve this, I recommend using a dictionary to store all of your servers to select from like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NEPacketTunnelVPNDemo
Then you need an iPhone. Network Extension App cannot run in iOS Simulators, you need a real iPhone to debug.
Login Apple developer portal, register 2 new App IDs, one for App target and another for NetworkExtension tunnel target. And make sure App Groups and Network Extensions are checked in App Services section.
Register an App Group in developer portal as well
Then, again in App IDs section of developer portal, edit the 2 App IDs you created at 3rd step, configure App Groups to the app group you created at 4th step.
Also in developer portal, generate 2 iOS App Development provision profiles for the 2 App IDs created before, ~~~make sure Network Extension entitlement is selected on 'Do you need additional entitlements?' page~~~ (2017-12-27 Update: This is probably not needed as well). Then download them and save them to disk.
Open this xcodeproj with XCode, select NEPacketTunnelVPNDemo target, in General > Identity section, change Bundle Identifier to App ID you created. Then import profiles you generated in General > Signing (Debug) section and General > Signing (Release) section.
Do the same thing for NEPacketTunnelVPNDemoTunnel target.
Find a Linux machine, build and run simple-vpn-demo, fill its IP address to ViewController.swift.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page