From e70ee5b59306ea37dd0c72603c61b33b1555def9 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 11 Nov 2014 14:40:18 +0100 Subject: Added proxy java classes. --- doc/PacIPv6.txt | 6 + doc/changelog.txt | 56 ++ doc/internet_explorer_info.txt | 4 + doc/mac_osx.txt | 7 + doc/misc_links.txt | 5 + doc/pac_files_docu.html | 1182 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1260 insertions(+) create mode 100644 doc/PacIPv6.txt create mode 100644 doc/changelog.txt create mode 100644 doc/internet_explorer_info.txt create mode 100644 doc/mac_osx.txt create mode 100644 doc/misc_links.txt create mode 100644 doc/pac_files_docu.html (limited to 'doc') diff --git a/doc/PacIPv6.txt b/doc/PacIPv6.txt new file mode 100644 index 0000000..3b3587e --- /dev/null +++ b/doc/PacIPv6.txt @@ -0,0 +1,6 @@ + +PAC IPV6 in Windows Vista and newer +http://blogs.msdn.com/b/wndp/archive/2006/07/18/ipv6-wpad-for-winhttp-and-wininet.aspx + +And the extension specs at: +http://blogs.msdn.com/b/wndp/archive/2006/07/13/ipv6-pac-extensions-v0-9.aspx \ No newline at end of file diff --git a/doc/changelog.txt b/doc/changelog.txt new file mode 100644 index 0000000..4bcff46 --- /dev/null +++ b/doc/changelog.txt @@ -0,0 +1,56 @@ +Change Log: +This file contains the change log. The changes are marked with the following symbology. + ++ for a new feature +- for a removed feature +* for a modified feature or a bugfix + +----------------- +Current version +* Fixed issue 29 : KDE settings file was not found on KDE4. This is solved now. +* Fixed issue 25 : Disabled DTD and schema validation in settings parsers. + +20120920 +* Improved the fix for issue 26 PAC download recursion bug + +20120905 +* Fixed issue 26 : Implemented (hopefully) better fix for PAC download recursion bug +* Fixed issue 27 + 22 : JavaProxySearch was used always even if no http.proxyHost property was set. + +20120727 +* Fixed issue 19 : Added check to return null if no KDE settings are available. +* Fixed issue 20 : Fix in isInNet method. Resolve host names to IP addresses. +* Fixed issue 21 : Improved handling of empty/invalid URIs + +20111102 +* Fixed issue 14 : Added code to cleanup temporary dll files that were not deleted on VM exit. +* Fixed issue 18 : Added code to support the https.proxy system properties too. +* Fixed issue 9 : IE PAC file urls are now patched to be in line with Firefox URLs. ++ Added support for automatic retry if PAC returns a list of fallback proxies. ++ Started to implement IPv6 support + +20110515 ++ Added (experiemental) support for Max OSX. This is not very well tested yet but should work. ++ Fixed issue 15 : The Firefox proxy search lacked support for socks proxy. This is now available. +* Fixed issue 12 : The PAC JavaScript method isInNet did not work for all patterns. This is fixed now. + +20110210 +* Fixed issue 11: Parsing was unreliable when a PAC script returned more than one proxy +* Some code cleanup to fix some minor problems (platform detection issues and others) ++ Added a debug system property "com.btr.proxy.pac.overrideLocalIP" for the PAC parser ++ Added Support for the IE "Bypass Proxy Server for local addresses" feature + +20100914 ++ PAC support on Java 1.6 will now use the javax.script framework and the internal javascript engine that is shipped with JRE6. This will allow you to support PAC without bundling the Rhino engine which will dramatically reduce the footprint of the library. Java 1.5 will still be supported but then you need to bundle it with the Rhino engine. ++ Added contributed dlls to support 64 windows version for the IE proxy detection. +* Some fixes for the http client that is used to download PAC scripts from a webserver. We accept now all content-type send by the server and we support now different charsets for the scripts. +* Fixed some unit tests that did not pass and did some other small fixes. + +20100724 +* Fixed Issue 5: PAC Parser was not working correctly in multithreaded environments. + +20100411 +* Fixed Issue 4: Improved parser used to parse proxy urls from environment varibales and other places + +Older +Did not track changes for older releases \ No newline at end of file diff --git a/doc/internet_explorer_info.txt b/doc/internet_explorer_info.txt new file mode 100644 index 0000000..6b49928 --- /dev/null +++ b/doc/internet_explorer_info.txt @@ -0,0 +1,4 @@ + +The following article gives a good description of IEs "Bypass Proxy Server for local addresses" feature and how it works. + +http://www.windowsreference.com/internet-explorer/bypass-proxy-server-for-local-addresses-in-internet-explorer-explained/ \ No newline at end of file diff --git a/doc/mac_osx.txt b/doc/mac_osx.txt new file mode 100644 index 0000000..df9c18e --- /dev/null +++ b/doc/mac_osx.txt @@ -0,0 +1,7 @@ +Settings are stored in a XML file that can be found at + +/Library/Preferences/SystemConfiguration/preferences.plist + +The plist file format is specified under + +http://www.apple.com/DTDs/PropertyList-1.0.dtd diff --git a/doc/misc_links.txt b/doc/misc_links.txt new file mode 100644 index 0000000..b16885f --- /dev/null +++ b/doc/misc_links.txt @@ -0,0 +1,5 @@ + +Oracle iPlanet Web Proxy Server +-------------------------------- +http://download.oracle.com/docs/cd/E21692_01/821-1882/adyrr/index.html + diff --git a/doc/pac_files_docu.html b/doc/pac_files_docu.html new file mode 100644 index 0000000..9e08bf8 --- /dev/null +++ b/doc/pac_files_docu.html @@ -0,0 +1,1182 @@ + +
+ + + + + + +(There are several examples and tips in the end of this document) +
+
+
+
+
+
The proxy autoconfig file is written in JavaScript. The file must define +the function: +
function FindProxyForURL(url, host) + { + ... + }+which will be called by the Navigator in the following way for every URL +that is retrieved by it: +
ret = FindProxyForURL(url, host);+where: +
proxy.pac+Note 1: You should save the JavaScript function by itself, +not embed it in HTML. +
Note 2: The examples in the end of this document are +complete, +there is no additional syntax needed to save it into a file and use it +(of course, the JavaScripts have to be edited to reflect your site's domain +name and/or subnets). +
application/x-ns-proxy-autoconfig+If using a Netscape server, edit the mime.types file in the config +directory. If using Apache, CERN or NCSA servers, use the AddType +directive. +
If the string is null, no proxies should be used. +
The string can contain any number of the following building blocks, +separated by a semicolon: +
+
+
The Navigator will automatically retry a previously unresponsive proxy +after 30 minutes, then after 1 hour from the previous try (always adding +an extra 30 minutes). +
If all proxies are down, and there was no DIRECT option specified, +the Navigator will ask if proxies should be temporarily ignored, and direct +connections attempted. The Navigator will ask if proxies should be retried +after 20 minutes has passed (then the next time 40 minutes from the previous +question, always adding 20 minutes). +
+
+
+
+
+
+
+
+
+
+
Pattern and mask specification is done the same way as for SOCKS configuration. +
+
+
+
+
Actually, currently the patterns are shell expressions, not +regular expressions. +
+
+
SUN MON TUE WED THU FRI SAT+ +
+
+
If only one parameter is present, the function yeilds a true value on +the weekday that the parameter represents. If the string +"GMT" +is specified as a second parameter, times are taken to be in GMT, otherwise +in local timezone. +
If both wd1 and wd1 are defined, the condition is +true if the current weekday is in between those two weekdays. Bounds are +inclusive. If the "GMT" parameter is specified, times are taken +to be in GMT, otherwise the local timezone is used. +
+
+
JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC+ +
+
Even though the above examples don't show, the "GMT" parameter
+can be specified in any of the 9 different call profiles, always as the
+last parameter.
+
+
+
+
+
+
+
+
function FindProxyForURL(url, host) + { + if (isPlainHostName(host) || + dnsDomainIs(host, ".netscape.com")) + return "DIRECT"; + else + return "PROXY w3proxy.netscape.com:8080; DIRECT"; + }+Note: This is the simplest and most efficient autoconfig file for +cases where there's only one proxy. +
+
function FindProxyForURL(url, host) + { + if ((isPlainHostName(host) || + dnsDomainIs(host, ".netscape.com")) && + !localHostOrDomainIs(host, "www.netscape.com") && + !localHostOrDoaminIs(host, "merchant.netscape.com")) + + return "DIRECT"; + else + return "PROXY w3proxy.netscape.com:8080; DIRECT"; + }+The above will use the proxy for everything else except local hosts in +the netscape.com domain, with the further exception that hosts +www.netscape.com +and +merchant.netscape.com will go through the proxy. +
Note the order of the above exceptions for efficiency: localHostOrDomainIs() +functions only get executed for URLs that are in local domain, not for +every URL. Be careful to note the parentheses around the or expression +before the and expression to achieve the abovementioned efficient +behaviour. +
+
function FindProxyForURL(url, host) + { + if (isResolvable(host)) + return "DIRECT"; + else + return "PROXY proxy.mydomain.com:8080"; + }+The above requires consulting the DNS every time; it can be grouped smartly +with other rules so that DNS is consulted only if other rules do not yield +a result: +
function FindProxyForURL(url, host) + { + if (isPlainHostName(host) || + dnsDomainIs(host, ".mydomain.com") || + isResolvable(host)) + return "DIRECT"; + else + return "PROXY proxy.mydomain.com:8080"; + }+ +
function FindProxyForURL(url, host) + { + if (isInNet(host, "198.95.0.0", "255.255.0.0")) + return "DIRECT"; + else + return "PROXY proxy.mydomain.com:8080"; + }+Again, use of DNS in the above can be minimized by adding redundant rules +in the beginning: +
function FindProxyForURL(url, host) + { + if (isPlainHostName(host) || + dnsDomainIs(host, ".mydomain.com") || + isInNet(host, "198.95.0.0", "255.255.0.0")) + return "DIRECT"; + else + return "PROXY proxy.mydomain.com:8080"; + }+ +
Furthermore, the three remaining proxy servers share the load based +on URL patterns, which makes their caching more effective (there is only +one copy of any document on the three servers -- as opposed to one copy +on each of them). The load is distributed like this: +
Proxy | + +Purpose | +
---|---|
#1 | + +.com domain | +
#2 | + +.edu domain | +
#3 | + +all other domains | +
#4 | + +hot stand-by | +
All local accesses are desired to be direct. All proxy servers run on +the port 8080 (they wouldn't need to). Note how strings can be concatenated +by the + operator in JavaScript. +
function FindProxyForURL(url, host) + { + if (isPlainHostName(host) || dnsDomainIs(host, ".mydomain.com")) + return "DIRECT"; + else if (shExpMatch(host, "*.com")) + return "PROXY proxy1.mydomain.com:8080; " + + "PROXY proxy4.mydomain.com:8080"; + else if (shExpMatch(host, "*.edu")) + return "PROXY proxy2.mydomain.com:8080; " + + "PROXY proxy4.mydomain.com:8080"; + else + return "PROXY proxy3.mydomain.com:8080; " + + "PROXY proxy4.mydomain.com:8080"; + }+ +
function FindProxyForURL(url, host) + { + if (url.substring(0, 5) == "http:") { + + return "PROXY http-proxy.mydomain.com:8080"; + } + else if (url.substring(0, 4) == "ftp:") { + + return "PROXY ftp-proxy.mydomain.com:8080"; + } + else if (url.substring(0, 7) == "gopher:") { + + return "PROXY gopher-proxy.mydomain.com:8080"; + } + else if (url.substring(0, 6) == "https:" || + url.substring(0, 6) == "snews:") { + + return "PROXY security-proxy.mydomain.com:8080"; + } + else { + + return "DIRECT"; + } + }+Note: The same can be accomplished using the +shExpMatch() +function described earlier; for example: +
... + if (shExpMatch(url, "http:*")) { + return "PROXY http-proxy.mydomain.com:8080; + } + ...+ +
+
+
+
Help | Site Map | How to Get Netscape Products | Advertise With Us | Add Site | Custom Browser Program |
+ |
+ +Autos | Business | Computing & Internet | Entertainment | Family | Games | Health | Lifestyles | Local | Netscape | Netscape Open Directory | News | Personal Finance | Real Estate | Research & Learn | Shopping | Small Business | Sports | Travel |
+
+© 1999 Netscape, All Rights Reserved. Legal & Privacy Notices This site powered by Netscape SuiteSpot servers. |
+
+
+
+
+