如何通过代理服务器在 Ruby 中实现远程处理?
我们正在考虑将 Ruby 用于客户端-服务器(非基于 Web)项目,其中客户端和服务器都将用 JRuby 编写。客户端(Windows)将位于带有代理服务器的公司防火墙后面,而服务器将位于云中。我们知道 DRb 使 ruby-to-ruby 远程处理变得非常容易,但尚不清楚是否DRb 通过代理服务器工作。有办法做到这一点吗?
或者,由于我们使用的是 JRuby,因此我们考虑使用 Java RMI 通过 HTTP
We're looking at using Ruby for a client-server (non-web based) project where both the client and server would be written in JRuby. The client (Windows) would sit behind a corporate firewall with a proxy server and the server would sit out in the cloud. We know that DRb makes ruby-to-ruby remoting very easy but it's unclear whether DRb works over a proxy server. Is there a way to do this?
Alternatively, since we're using JRuby, we've thought about using Java RMI over HTTP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为最好的选择是编写一些简单的测试脚本并在以某种方式提交之前尝试一下。周围有各种不同的代理服务器,很难明确回答您的问题。如果(正如我怀疑的那样)您在企业环境中,可能也需要通过一个或三个防火墙(这可能会阻止“非标准”端口 - 对 DRb 不利)或阻止服务器进程(如果您想要双向通信,则会出现问题) )。
此外,我建议抽象您的流程通信。根据您公司的性质以及您的应用程序在该公司的配置文件,您可能会发现代理和防火墙已更改,而没有考虑您的要求。通过抽象通信,您可以在需要时更好地采用另一种技术。
I think your best bet is to write some simple test scripts and try it before committing one way or another. There are various different proxy servers around, and its hard to answer your question definitively. If (as I suspect) your in a corporate environment there's probably a firewall or three to go through too (which may block "non-standard" ports - bad for DRb) or block server processes (a problem if you want two-way comms).
Furthermore, I'd suggest abstracting your process communications. Depending on the nature of your company, and the profile of your app with that company, you may find the proxy and firewall changed without consideration for your requirements. By abstacting the comms, you're in a better position to slot another technique in if needs be.