Java Applet Network Connection

99封情书 提交于 2019-12-20 02:22:11

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/836007/java-applet-network-connection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!