1 Project Description |
1.1 Overview
This goal of this RFE is to change the current mechanism of Java Plug-in to handle the auto proxy configuration. Currently we just return the first match of proxy server in the returned list of "FindProxyForURL" function no matter whether it is dead or alive. This RFE is to make Java Plug-in to return the first alive proxy in the list.
function FindProxyForURL(url, host) {
return "PROXY wcscab.SFBay.Sun.COM:8080;" +
"PROXY
wcscaa.SFBay.Sun.COM:8080;" +
"PROXY
wcmpka.Eng.Sun.COM:8080;" +
"PROXY
wcnwkc.EBay.Sun.COM:8080";
}
// End FindProxyForURL
You can change the return value to add an invalid proxy server at the
beginning of this list. Go to Java control panel, open "Proxies" tab and
point the URL of the script into the Autoconfig Proxy URL field. After
changing this, apply the change and open the browser and go to java.sun.com,
you should be able to see the applet working after the fix of this RFE.
2 Technical Description |
1. Find the first alive proxy server from the returned list of "FindProxyForURL".
2. If any proxy server is down, but it is up after 10 minutes, plugin may pick up and use it.
3. If any proxy server is up, but it is down after 30 minutes, plugin may ignore to use it.
4. If all the proxy server are dead, return the first proxy found.
The second goal guarantees that if the admin shut down the proxy and turn on it later, the proxy can be used at most after 10 minutes. The third goal makes plugin be smart enough to ignore the dead proxy. To make sure it does not have regression, we add the fourth one.
Here is the algorithm. Assume that each time the function "FindProxyForURL" return some string like p1: p2: p3:...pi...pn (pi includes host and port number, 1<=i<=n). A table Tp which can be implemented as a hash map is used to cache the proxy information. Each entry of Tp uses proxy as a key, the status (alive and dead) plus the timestamp as the value.
For i = 1.. n
Look up pi in Tp.
If it is not in the cache
Ping pi, if it is alive,
store it in the cache and update the timestamp. Return.
If pi is timeout (meaning the difference between
the current time and the time recorded in the cache is greater or equal
to 30 minutes/10 minutes depends on the status of the proxy).
Ping pi, if alive, update
the cache entry. Return
If pi is alive, return
else i = i+1, continue the loop.
// If out of the loop, all the proxy are dead
return p1.
Two notes:
1. There is a timeout value associated with the ping action. The default
value is 2seconds. The user may change this value by changing the
system property "javaplugin.proxy.timeout".
2. Considering a special case. If pi is DIRECT, we need to be able to correctly handle this. So we prepopulte the table with a "DIRECT" entry and we always think "DIRECT" is alive, so it can be returned correctly.
* public void setPingTimeout(int timeout);
parameter: timeout, is the ping timeout in milliseconds
* public int getPingTimeout();
return value: the current ping timeout using.
3 Marketing |
The customers are requesting that the plug-in implement the same behavior. That is, if the attempt to contact the first proxy fails, the next proxy in the list should be used, and so on.
4 Management and Planning |
|
Complete | Started | Not Started | Difficulties | Trouble |
Appendices (as needed, suggestions below) |
|
Revision History |
|