Giter Site home page Giter Site logo

lattice0 / true_libopenvpn3 Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 77 KB

A way to use libopenvpn3 as a true library with your own tun implementation, therefore sending/receiving VPN packets on userspace.

License: MIT License

C++ 96.21% CMake 2.18% Shell 0.20% Dockerfile 0.73% Python 0.67%
vpn openvpn openvpn3 tun tap networking

true_libopenvpn3's Introduction

True libopenvpn client

Use OpenVPN as a true library, no TUN/TAP system calls.

For a full example putting everything together to do an HTTP request over userspace OpenVPN, check https://github.com/lattice0/hyper_vpn

How it works?

Official OpenVPN3 app only knows about IP packets, it does not know how to transport TCP packets. So, everything is done through a TUN interface that it opens in the operating system. This library provides a client implementation that creates a virtual TUN, that is, a class that can simulate how a TUN works. Therefore, you can do whatever you want and transport your own IP packets. I used OpenVPN3 as a dependency, so no patches are needed, I just built upon it.

You need a TCP/IP stack, otherwise because this library is only concerned with transporting IP packets. Since there is no decent userspace stack in C/C++, I'm using Rust's smoltcp on my projects.

Why?

This library is useful because you don't need privileged capabilities to create/access tun/tap interfaces, so you can support OpenVPN connections on your app on Android for example without requiring VPN permissions. Also, you can connect to multiple OpenVPN servers through multiple profiles and send packets through them on Android, where traditionally it would let you have just one connection at the same time.

Rust interface

For a Rust interface, look at https://github.com/lattice0/true_libopenvpn3_rust. I use Rust because I plug the https://github.com/smoltcp-rs/smoltcp library, which is a TCP stack that can be plugged together with this library so we can finally send regular TCP/UDP packets, and thus send things like HTTP requests.

Contributing

I need to bump to the latest OpenVPN3, and also make some things more readable, as well as remove libtins dependency. PRs are welcome!

TODO:

  • bump to latest openvpn3
  • clean lots of stuff
  • remove libtins dependency (it's only used for generating an IP address lol)
  • fix proton vpn android compilation (test on android, and possibly make iOS work too from the proton ios app)

true_libopenvpn3's People

Contributors

lattice0 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

shabbirhasan1

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.