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

Just a feedback! #2

Open
savely-krasovsky opened this issue Nov 11, 2023 · 4 comments
Open

Just a feedback! #2

savely-krasovsky opened this issue Nov 11, 2023 · 4 comments

Comments

@savely-krasovsky
Copy link

savely-krasovsky commented Nov 11, 2023

A very good example of using OpenVPN3 with Golang!

But I wanted to highlight that you could use swig natively with Golang:
just take ovpncli.i from openvpn3 repo and rename it to ovpncli.swigcxx. Then create new ovpncli.go file and just add cgo comments with cppflags and ldflags. Then Golang should automatically call swig to generate bindings and compile at the same time. You won't need to patch generated files in this case.

Also I would reuse headers from submodule you already created by passing -I${SRCDIR}/third_party/openvpn3 -I${SRCDIR}/third_party/openvpn3/client in cgo LDFLAGS.

And finally I would manually add new vector to newly copied ovpncli.swigcxx:

%template(ClientAPI_KeyValueVector) vector<openvpn::ClientAPI::KeyValue>;

In that case you would able to configure OpenVPNClient with key-value entries, not only with entire text config, much usable to build GUI client.

@Vai3soh
Copy link
Owner

Vai3soh commented Nov 12, 2023

Спасибо, за обратную связь. Попробую разобраться как будет время. Гуй клиент тут https://github.com/Vai3soh/goovpn

@Vai3soh Vai3soh pinned this issue Nov 12, 2023
@savely-krasovsky
Copy link
Author

savely-krasovsky commented Nov 12, 2023

@Vai3soh а вы не ловите местами сегфолтов, случайно? Есть подозрение, что openvpn3 использует thread-local storage и вызовы плюсовых методов из разных тредов иногда её крашат.

@Vai3soh
Copy link
Owner

Vai3soh commented Nov 12, 2023

Я пользуюсь переодически гуй клиентом (goovpn) и не замечал чтобы он крашился.

@savely-krasovsky
Copy link
Author

@Vai3soh спасибо за фидбек, пока думается, что openvpn3 не совсем ожидает запросов к себе из разных тредов.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants