NAT 端口转发的最佳选项是什么?

发布于 2024-07-06 18:22:18 字数 534 浏览 10 评论 0原文

我想让用户轻松地将 NAT 上的端口转发到我的 C++ 应用程序的本地计算机。 我想让这个工作在 OSX 和 OSX 上运行。 视窗。 Linux 将是一个很大的优势,但 Linux 用户可能更喜欢手动转发端口,因此不必担心。 LGPL 类型代码没问题,但我不能使用任何直接 GPL 的东西。

我很想听听任何人在这一领域的想法或经验,但我想到了一些具体问题:

  • 是否有公认的 UPNP 最佳库? MiniUPNP 客户端看起来可能可以工作,但是还有其他东西吗?
  • Bonjour 怎么样? 我可以在 OSX 计算机上依赖它吗?
  • 所有大型 BitTorrent 应用程序都必须处理这个问题,那么是否有关于它们如何做到这一点的现有调查? Skype 怎么样?

I'd like to make it easy for users to forward a port on their NAT to their local machine for my C++ app. I'd like to make this work on OSX & Windows. Linux would be a great bonus, but Linux users are probably more comfortable forwarding ports manually, so it is less of a concern. LGPL type code is OK, but I can't use anything that is straight GPL.

I'd love to hear any thoughts or experiences anyone has had in this area, but a few specific questions come to mind:

  • Is there a recognized best library for UPNP? The MiniUPNP client looks like it might work, but is there anything else out there?
  • What about Bonjour? Can I rely on it for OSX computers?
  • All the big bittorrent apps have to deal with this, so is there an existing survey of how they do it? What about Skype?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

舞袖。长 2024-07-13 18:22:18

MiniUPNP 至少由一个 BitTorrent 客户端(传输)使用,并且应该可以正常工作。

MiniUPNP is used by at least one bittorrent client (Transmission) and should work fine.

溺深海 2024-07-13 18:22:18

OS X 和 Windows 上的 Bonjour 均可用于与支持 uPNP 或 NAT-PMP 的路由器进行端口映射。 我没有使用 API (DNSServiceNATPortMappingCreate),但我已成功在 NAT-PMP 路由器后面的 Windows 和 OS X 上发布了广域服务。 我不确定您的 Windows 用户是否愿意安装 Bonjour(尽管如果他们使用 iTunes 或 Safari,他们可能已经安装了 Bonjour)来使用您的应用程序,但在 OS X 上的支持应该不是问题。

Bonjour on both OS X and Windows can be used to do port mappings with routers that support uPNP or NAT-PMP. I haven't used the API (DNSServiceNATPortMappingCreate) but I have successfully published wide-area services on both Windows and OS X behind a NAT-PMP router. I'm not sure if your Windows users will want to install Bonjour (although they may already have it if they use iTunes or Safari) to use your app but on OS X support shouldn't be an issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文