Skip to content

Just a feedback! #2

@savely-krasovsky

Description

@savely-krasovsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions