go - 将 WireGuard 嵌入到 Windows 上的 Go 应用程序中

标签 go wireguard

我正在用 Go 编写一个应用程序,它将使用 WireGuard 隧道进行通信。我想将 WireGuard 嵌入应用程序中,而不是安装单独的 WireGuard 程序。我知道我可以使用wireguard.dll和tunnel.dll嵌入一般应用程序中。但鉴于我的应用程序也是用 Go 编写的,这仍然是正确的方法吗?或者我应该从 WireGuard-Windows 程序中调用 go 库?

文档很少,并且大部分不是基于 Go 的。这种方法在 Go 场景中还适用吗?

最佳答案

您可以使用zx2c4 wireguard-go module ,( wireguard-windows 使用 wireguard-go 作为模块)

您可以在 main_windows.go 中查看示例:虽然 wireguard-windows 仍然是成熟的 Wireguard Windows 客户端,但这为您提供了从 Go 程序调用 Wireguard 的说明。

关于go - 将 WireGuard 嵌入到 Windows 上的 Go 应用程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69846561/

相关文章:

json - 当 json 输入结构错误时,Unmarshall 应返回错误

go - 在 Go 中合并 map

go - 从其他包导入的结构未定义

endpoint - Wireguard 配置文件中的 Endpoint 和 AllowedIPs 字段有什么区别?

installation - 无法通过 Wireguard 隧道访问 PiHole DNS 服务?

ios - wireguard ios,路由 ip+net : sysctl: operation not supported

programming-languages - Haskell 的类型类和 Go 的接口(interface)

go - 模板不必要地将 `<` 转义为 `&lt;` 但不是 `>`

embedded-linux - Yocto SYSTEMD_SERVICE 安装参数化服务 ("@.service")

Wireguard VPN - 如果以前有效,如何解决不支持的操作?