NAT 端口转发的最佳选项是什么?
我想让用户轻松地将 NAT 上的端口转发到我的 C++ 应用程序的本地计算机。 我想让这个工作在 OSX 和 OSX 上运行。 视窗。 Linux 将是一个很大的优势,但 Linux 用户可能更喜欢手动转发端口,因此不必担心。 LGPL 类型代码没问题,但我不能使用任何直接 GPL 的东西。
我很想听听任何人在这一领域的想法或经验,但我想到了一些具体问题:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MiniUPNP 至少由一个 BitTorrent 客户端(传输)使用,并且应该可以正常工作。
MiniUPNP is used by at least one bittorrent client (Transmission) and should work fine.
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.