Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed lokinet #2145

Open
zn3x opened this issue Mar 11, 2023 · 11 comments
Open

Embed lokinet #2145

zn3x opened this issue Mar 11, 2023 · 11 comments
Labels
embedded lokinet issues related to running lokinet in embedded mode with no vpn interface. enhancement New feature or request linux linux specific issue macos issues relating to apple's desktop os mobile android and/or iOS related packaging refactor code that hasn't been refactored yet. windows

Comments

@zn3x
Copy link

zn3x commented Mar 11, 2023

From here, this still seems like a work in progress.
Is there any current api to integrate lokinet and use it in another program without the need for virtual interface?

@zn3x zn3x added the bug Something isn't working label Mar 11, 2023
@majestrate
Copy link
Contributor

we are currently fixing up the internals right now ( #2141 #2119 ) but the public C api for embedded lokinet is currently defined in C headers: https://github.com/oxen-io/lokinet/tree/dev/include/ (llarp.hpp will be removed, it's a header for internals).

@zn3x zn3x closed this as completed Mar 11, 2023
@zn3x zn3x reopened this Mar 11, 2023
@zn3x
Copy link
Author

zn3x commented Mar 11, 2023

Thanks, I've taken a look at it.
Is there any way to pass persistent keys to have same address when initializing lokinet's context, the same thing done here to run a mumble service so an application can have it's own hidden service hosted on persistent address

@majestrate
Copy link
Contributor

currently we dont have an API defined for configuration. it's all running with a set of predefined ephemeral defaults. additionally, the UDP api is very likely to change entirely.

@zn3x zn3x closed this as completed Mar 21, 2023
@majestrate majestrate added enhancement New feature or request packaging mobile android and/or iOS related refactor code that hasn't been refactored yet. macos issues relating to apple's desktop os windows linux linux specific issue embedded lokinet issues related to running lokinet in embedded mode with no vpn interface. and removed bug Something isn't working labels Mar 22, 2023
@majestrate majestrate added this to the embedded-lokinet milestone Mar 22, 2023
@majestrate majestrate reopened this Mar 22, 2023
@majestrate
Copy link
Contributor

i'll keep this open as a stub issue

@zn3x
Copy link
Author

zn3x commented Mar 29, 2023

Hello, I've been lately experimenting with adding embedded lokinet to a rust app with C-bindings, repo is here.

As a POC, I want to create a lokinet stream, I first start by creating a new context with lokinet_context_new(), and starting it with lokinet_context_start(), then I keep waiting until context is ready with lokinet_status(), then I create a lokinet stream with lokinet_outbound_stream() which returns a host:port, I create a tcp stream to that host:port tuple, the moment some IO is done, lokinet panicks with an internal errors (full lokinet log here)

I tried different branches dev and dev-next (never managed to compile stable because of no fixed depencies versions). I'm not too sure if I'm doing something wrong, but I have been following this. cmake compilation flags are here

@majestrate
Copy link
Contributor

Hello, I've been lately experimenting with adding embedded lokinet to a rust app with C-bindings, repo is here.

As a POC, I want to create a lokinet stream, I first start by creating a new context with lokinet_context_new(), and starting it with lokinet_context_start(), then I keep waiting until context is ready with lokinet_status(), then I create a lokinet stream with lokinet_outbound_stream() which returns a host:port, I create a tcp stream to that host:port tuple, the moment some IO is done, lokinet panicks with an internal errors (full lokinet log here)

I tried different branches dev and dev-next (never managed to compile stable because of no fixed depencies versions). I'm not too sure if I'm doing something wrong, but I have been following this. cmake compilation flags are here

we have a draft pr for fixing some internals in embedded lokinet, see #2141

@majestrate
Copy link
Contributor

additionally, lokinet is licensed GPL3 (not LGPL3) at the moment. i dont think apache 2 is a compatible license for your rust lib. just a heads up.

@planetoryd
Copy link

How about adding lokinet support to tun2proxy ?

I'm still working on that per-app-vpn problem. I will use tun2proxy as a component of netns-proxy

@majestrate
Copy link
Contributor

majestrate commented Aug 29, 2023 via email

@spookycheekybreeky
Copy link

Hello,

Some example avaible for https://github.com/oxen-io/lokinet/tree/dev/include/lokinet ? :3

@planetoryd
Copy link

planetoryd commented Nov 7, 2023

is there any update on this. so i finally got the arcane knowledge about that per-app-vpn niche, namespaces, mounts, etc.

I was writing a ton of bloat. The per-app-vpn (with cases like proxychained Tor + another proxy) should be handled by systemd, which I just started reading about, which gets hate idk.

up to now there is no accessible tool for per-app-vpn on linux, and I'd build such a tool for flatpak, which gets hate idk.

It should be possible to do all these things with user namespaces, passing fds, mounts, w/o root. It means proxychains should not exist.

It's also a better solution than opensnitch, or whatever per-app-routing-firewall, which is bloated therefore insecure, which has python, golang and stuff.

there is no reliable (paranoid-level, or is it really paranoid ?) per-app-vpn tooling on android, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded lokinet issues related to running lokinet in embedded mode with no vpn interface. enhancement New feature or request linux linux specific issue macos issues relating to apple's desktop os mobile android and/or iOS related packaging refactor code that hasn't been refactored yet. windows
Projects
None yet
Development

No branches or pull requests

4 participants