简体   繁体   English

Java代理小程序:这样可能吗?

[英]Java proxy applet: is such thing possible?

I am wondering whether it is technically possible to create a proxy within a java applet. 我想知道在Java小程序内创建代理在技术上是否可行。

And would it then be possible to route all further browser requests through this java applet proxy? 然后可以通过该Java Applet代理路由所有其他浏览器请求吗?

Eg., if the user would browse to google.com, could the default behaviour be replaced by this proxy applet? 例如,如果用户浏览到google.com,此代理小程序可以替换默认行为吗?

Any feedback is appreciated. 任何反馈表示赞赏。

Technically is possible, but I think it might be very expensive and time consuming to build. 从技术上讲是可行的,但我认为构建起来可能非常昂贵且耗时。 You might need to do something similar as what the Juniper VPN client does. 您可能需要执行与Juniper VPN客户端相似的操作。 It runs an applet which run an OS specific app that changes the proxy settings, and, in you case, the same applet can run as a proxy server. 它运行一个applet,该applet运行一个特定于OS的应用程序,该应用程序会更改代理设置,并且在这种情况下,同一applet可以作为代理服务器运行。 The OS application also has to revert the proxy settings if it detects that the applet died or was closed. 如果OS应用程序检测到该小应用程序已死亡或已关闭,则还必须还原代理设置。 In the case of Juniper, it changes the system hosts file instead of the proxy settings. 对于瞻博网络,它将更改系统主机文件,而不是代理服务器设置。

As for Mat concern: the user will get a few pop ups telling her to be SUPER sure of running the app and installing the OS app... again, in the same way that happens with Juniper :) 关于Mat的问题:用户会弹出几个窗口,告诉她要超级确定运行该应用程序并安装OS应用程序...再次,与Juniper一样:)

EDIT 编辑

It depends how many OSs / browsers you want to support. 这取决于您要支持多少个操作系统/浏览器。 In worst case scenario you'll need an app to set and rollback the system proxy settings for Windows, Mac, Linux (I don't even know if there's system wide configuration for the proxy configuration). 在最坏的情况下,您需要一个应用来设置和回滚Windows,Mac,Linux的系统代理设置(我什至不知道代理配置是否有系统范围的配置)。 Then (as far as I remember) the way to sign an applet for IE is different than for all the other browsers. 然后(据我所记得),为IE签名applet的方式不同于所有其他浏览器。

What I'm trying to say is that it's not a weekend job, it could easily take a couple of months to code and have plenty of issues with certain combination of OS / browsers. 我要说的是,这不是周末工作,可能很容易花费几个月的时间编写代码,并且某些OS /浏览器组合存在很多问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM