Java 小程序网络连接 [英] Java Applet Network Connection

查看:34
本文介绍了Java 小程序网络连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的小程序在网络浏览器中运行时,它被阻止在任何外部网络连接.是否可以更改任何设置以允许其建立连接?

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.

谢谢

~凯尔 G

推荐答案

Applet 可以连接回下载它们的服务器(同源策略").从 6u10 开始,他们还可以使用适当的 crossdomain.xml 文件(google it)访问站点.

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.

另一种选择是让您的 Web 服务器机器转发连接.但是,要安全地做到这一点也很棘手.

Another option is to have your web server machine forward on connections. However, that again is tricky to do securely.

这篇关于Java 小程序网络连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆