Reputation: 842
I'm developing an Android application and want it to connect to an OpenVPN Server. Since Android 4.0 there is a VPNService class. This class however needs to intercept all the network packets(and require special permissions) because it is apperently running on the Internet Protocol. However as far as I understand, OpenVPN is running on-top of TCP or UDP(my server is configured to use UDP). I only need to tunnel the traffic from my own application through the VPN tunnel.
I found the follwing project: ics-openvpn. However it also uses the VPNService class and intercepts all the packages.
Upvotes: 4
Views: 5062
Reputation: 1575
You need to use VpnService
for creating an application of OpenVPN which takes ovpn file as input for configuration on client side like OpenVPN Connect. So any person can change configuration according to their need. Also, you have to configure the server for OpenVPN. Take server of AWS EC2 or any other. While in configuring VPN on server side follow this link.
Upvotes: 2
Reputation: 6323
Sure, you can theoretically do UDP/OpenVPN in userspace/inside your app. But you would need to implement the whole TCP/IP inside your app since you need to emulate the whole VPN stack.
For a one app VPN like solution you are probably much better of using a SOCKS/HTTP proxy etc. library.
Upvotes: 4