Java Applet 网络连接
当我的小程序在网络浏览器中运行时,它被阻止无法进行任何外部操作 网络连接。 是否可以更改任何设置以允许其建立连接?
从桌面运行时它工作正常,但在浏览器中运行时它会受到限制。
谢谢
~凯尔·G
At the moment when my applet runs in a web browser it is blocked from making any outside
network connections. Is it possible to change any settings to allow it make connections?
It works fine when run from the desktop, but when in a browser it restricts it.
Thanks
~ Kyle G
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
小程序可以连接回下载它们的服务器(“同源策略”)。 从 6u10 开始,他们还可以使用适当的
crossdomain.xml
文件访问网站(谷歌搜索)。随机允许访问任何站点显然不会有利于安全。 您可以对代码进行签名并让插件允许用户删除安全性。 但是,这需要您了解安全性才能安全地完成此操作(大多数人不知道)。 对于“良好”的安全对话框,您需要由受信任的证书颁发机构签名的证书。
另一种选择是让您的 Web 服务器计算机转发连接。 然而,安全地做到这一点也很棘手。
Applets can connect back to the server they were downloaded from ("same origin policy"). From 6u10 they can also access sites with appropriate
crossdomain.xml
file (google it).Randomly allowing access to any site obviously isn't going to be good for security. You can sign your code and have the PlugIn allow users to remove security. However, that requires you know about security to do it safely (which most people don't) . For a "nice" security dialog you need a certificate signed by a trusted certificate authority.
Another option is to have your web server machine forward on connections. However, that again is tricky to do securely.