如何在防火墙后面将 RMI 与小程序客户端一起使用?
如何将 RMI 与防火墙后面的 applet 客户端一起使用?
如何将 RMI 与受防火墙保护的服务器和受防火墙保护的小程序客户端一起使用? (如果可能的话)
我知道RMI服务器使用端口1099(默认情况下,但这是可配置的); 然而,此后通信需要在不同的随机端口上有一个新的套接字。 我还知道您可以在客户端上为 RMI over HTTP 隧道设置代理,理论上这应该可以解决我的问题。 但我无法让它工作(我尝试在 XP 客户端上设置环境属性,但 Internet Explorer 一直忽略它们)。
How can I use RMI with a applet client behind a firewall?
How can I use RMI with a firewalled server and firewalled applet client? (If possible)
I know that the RMI server uses port 1099 (by default, but this is configurable); however after this the communication requires a new socket on a different random port. I also know that you can set the proxy on the client for RMI over HTTP tunneling which in theory should solve my issue. But I can't make it work (I tried setting the environmental properties on my XP client, but Internet Explorer keeps ignoring them).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
请参阅 http://java.sun.com/ javase/6/docs/technotes/guides/rmi/faq.html#firewall
See http://java.sun.com/javase/6/docs/technotes/guides/rmi/faq.html#firewall
如果服务器代码在您手中,您还可以通过提供自定义 RMISocketFactory 来限制 RMI 使用预定义端口,如下所述: http://insidecoffe.blogspot.com/2012/02/firewall-friently-rmi-port-fixing.html
(特别注意提示如果并行使用 JMX 可能会导致问题)
If the servers code is in your hand you could also restrict RMI to use a predifined port by providing a custom RMISocketFactory as described here: http://insidecoffe.blogspot.com/2012/02/firewall-friently-rmi-port-fixing.html
(Note specially the hint that it may cause problems if you use JMX in parallel)
我自己还没有深入研究它,但是在寻找我目前正在做的项目时,我遇到了 LipeRMI< /a>.
您可能想看一下它,因为它面向互联网使用,并提到“以可以位于本地网络、路由器或防火墙后面的方式隐藏客户端;”
编辑:
记得我不久前遇到的另一个实现称为 RMI Doves 1.0:Java RMI 防火墙问题的解决方案 您可能也想看看那个。
Have not looked into it to deeply my self yet, but while looking around for a project I am currently doing I came accross LipeRMI.
You might want to have a look at it as it geared towards internet usage and mentions "shadow the clients in such way they can be behind a local network, router or firewall;"
Edit:
Remembered another implementation I came across a while back called RMI Doves 1.0: Solution for Java RMI firewall problem you might want to have a look at that one as well.
在你的服务器中输入这样的代码:
in your Server put the code like this: