在企业场景中通过代理使用 TCP 隧道进行双工 WCF 连接

发布于 2024-11-03 17:34:19 字数 395 浏览 3 评论 0原文

我们正在为尚未发布的企业级 LOB 应用程序中的一项功能使用双工合约,该应用程序利用使用 WPF 构建的胖客户端和使用 WCF 构建的服务器

到目前为止,在开发过程中,我们一直在使用 net.tcp 绑定以获得最佳性能。现在部署即将到来,通过 Web 代理访问 Internet 等问题也已暴露出来,net.tcp 不再适用。

我已经开始使用 wsHttp 和 wsDualHttp,但同时意识到通过 Web 代理(以及 NAT 遍历)进行双工连接实际上是不可能的

现在我在想:为什么我不能建立一个 tcp 隧道(使用支持 Web 代理的专有软件,使用 HTTP CONNECT)并获得两全其美:代理支持、速度和安全性?

We're using a duplex contract for one feature in our yet to be released enterprise level LOB application that utilizes a thick client built with WPF and a server built with WCF.

During development so far we've been using the net.tcp binding for best performance. Now that deployment is coming up and issues such as internet access through a web proxy come to light, net.tcp isn't suitable anymore.

I've started using wsHttp and wsDualHttp but have realised in the meantime that duplex connections through a web proxy (and with NAT traversal) isn't really possible.

Now I'm thinking: why can't I set up a tcp tunnel (using proprietry software that supports web proxies, using HTTP CONNECT) and get the best of both worlds, proxy support, speed and security?

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

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

发布评论

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

评论(1

嘴硬脾气大 2024-11-10 17:34:19

看来这是一个常见的要求。

你的选择并不广泛。如果 Microsoft 的服务总线能够满足您的需求,它可能是您的最佳选择。其他选项是:

  • VPN:非常不言自明。
  • SSH:SSH 具有内置的隧道功能。如果您只有少量连接,您也许可以使用现成的 SSH 客户端和服务器,但如果连接数量较多,则很难确保它们都保持可靠连接。有几家公司制作了您可以构建的 SSH 组件(它们不能满足我们的需求),但它们更面向 SSH 的远程执行使用而不是隧道。
  • DIY TCP 隧道,这是一项艰巨的工作。并非不可能,但却是一项艰巨的任务。并且需要大量的测试来确保你的做法是正确的。

至于通过隧道连接运行 WCF,如果您采用该路线,则不会遇到任何问题。所有绑定和功能都有效——回调、可靠性、消息安全、传输安全、事务,一切都工作得很好。

It would seem this is a common requirement.

Your options are not expansive. Microsoft's Service Bus is probably your best bet, if it works for your needs. The other options are:

  • VPN: Pretty self-explanatory.
  • SSH: SSH has tunneling functionality built-in. If you only have a small number of connections, you might be able to use an off-the-shelf SSH client and server, but with a larger number of connections it's hard to ensure that they all stay connected reliably. Several companies make SSH components you might be able to build upon (they didn't work for our needs), but they are more oriented toward the remote-execution use of SSH than tunneling.
  • A DIY TCP tunnel, which is a big job. Not impossible, but a big job. And will require a tremendous amount of testing to make sure you've got it right.

As far as running WCF over a tunneled connection, if you go that route, you won't have any problems. All the bindings and features work-- callbacks, reliability, message security, transport security, transactions, all work just fine.

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