pax_global_header 0000666 0000000 0000000 00000000064 13026622520 0014510 g ustar 00root root 0000000 0000000 52 comment=76263133aa603f7a995e5e3bd3ff6d57f0c76a47
proxy-vole-proxy-vole-1.0.3/ 0000775 0000000 0000000 00000000000 13026622520 0015757 5 ustar 00root root 0000000 0000000 proxy-vole-proxy-vole-1.0.3/.gitignore 0000664 0000000 0000000 00000000076 13026622520 0017752 0 ustar 00root root 0000000 0000000 # Eclipse
.project
.settings
.classpath
bin/
# Maven
target/
proxy-vole-proxy-vole-1.0.3/CHANGELOG.md 0000664 0000000 0000000 00000010565 13026622520 0017577 0 ustar 00root root 0000000 0000000 #Change Log
This file contains the change log.
##Unreleased
##1.0.3
* Fixed issue #5: Failed to find SOCKS proxy with Java search strategy. Thanks to sake!
* Added proxy selection to README.md. Thanks to Guido Schnepp!
##1.0.2
* Fixed issue #2: NullPointerException if PAC method returns null
* Fixed issue #1: Caching with individual URLs might not be ideal
* Changes after receiving some mails from different people about ASL2 licensing
##1.0.1
* Fix NullPointerException in IEProxySearchStrategy.
##1.0.0
* Fork on github.
* Made it deployable to Maven Central for me (Maven coordinates, package names).
* Added OsxFirefoxProfileSource.
* Removed the Rhino Javascript parser needed for Java 5.
* Removed the Windows DLL and its sources.
* Port from JNI to JNA
##Last version of proxy-vole at Google Code repository
* Preparing migration to Maven
* We now support on Linux Gnome the dconf settings format
* Fixed issue 55 : Improved shExpMatch method
* Fixed issue 51 : UnsatisfiedLinkError if dll was cleaned up by another instance that is closed.
* Fixed issue 50 : Mixed white list with "local bypass" enabled
* Fixed issue 48 : Expiry date for redownload of pac script content was broken.
* Fixed issue 47 : If no PAC selector is available ignore the whitelist settings (OSX only).
##20131209
* Fixed issue with myIPAddress() returning 127.0.0.1 instead of the real address on linux
* Fixed issue 46 : Handle cleanup of temp files more robust
* Fixed issue 44 : Selecting bluetooth interface in OS/X 10.8
* Fixed issue 39 : Default timeout is used when fetching PAC script, causes 5 minute delay
* Fixed issue 38 : Detect invalid PAC scripts early and abort
* Fixed issue 36 : methods returned java.lang.String objects instead of JS strings
##20121203
* Fixed issue 31 : Improved the support for "no proxy" definitions.
* 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
* Added support for automatic retry if PAC returns a list of fallback proxies.
* Started to implement IPv6 support
* 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.
##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
* 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
* 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)
##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
proxy-vole-proxy-vole-1.0.3/LICENSE.md 0000664 0000000 0000000 00000024376 13026622520 0017377 0 ustar 00root root 0000000 0000000 Apache License
==============
_Version 2.0, January 2004_
_<>_
### Terms and Conditions for use, reproduction, and distribution
#### 1. Definitions
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
proxy-vole-proxy-vole-1.0.3/NOTICE.md 0000664 0000000 0000000 00000004073 13026622520 0017266 0 ustar 00root root 0000000 0000000 ##Copyright 2016 Markus Bernhardt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
##Copyright 2009 Bernd Rosstauscher
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY BERND ROSSTAUSCHER ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL BERND ROSSTAUSCHER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
proxy-vole-proxy-vole-1.0.3/README.md 0000664 0000000 0000000 00000017176 13026622520 0017252 0 ustar 00root root 0000000 0000000 #proxy-vole
Proxy Vole is a Java library to auto detect the platform network proxy settings.
Note: This library is a fork of the now dead [proxy-vole](https://code.google.com/p/proxy-vole/) project by Bernd Rosstauscher hosted at Google Code.
##Introduction
The library provides some proxy setting search strategies to read the proxy settings from the system config
(Windows, KDE, Gnome, OSX), browser config (Firefox, IE) or environment variables and provides you an ready to use proxy selector.
##Why a fork?
* Can't contact Bernd Rosstauscher.
* Google Code is dead by now.
* proxy-vole seems to be dead even longer. Last commit mid 2015. Last release end 2013.
* proxy-vole is not available on any public Maven repository. Needed to change the Maven coordinates and Java package names
to be able to push it to Maven Central on my own.
* I don't like the Windows DLL and usage of JNI. Replaced both by JNA.
##Usage
###Using the default strategy to find the settings
```Java
// Use the static factory method getDefaultProxySearch to create a proxy search instance
// configured with the default proxy search strategies for the current environment.
ProxySearch proxySearch = ProxySearch.getDefaultProxySearch();
// Invoke the proxy search. This will create a ProxySelector with the detected proxy settings.
ProxySelector proxySelector = proxySearch.getProxySelector();
// Install this ProxySelector as default ProxySelector for all connections.
ProxySelector.setDefault(proxySelector);
```
###Modifying the search strategy
```Java
// Create a not configured proxy search instance and configure customized proxy search strategies.
ProxySearch proxySearch = new ProxySearch();
if (PlatformUtil.getCurrentPlattform() == Platform.WIN) {
proxySearch.addStrategy(Strategy.IE);
proxySearch.addStrategy(Strategy.FIREFOX);
proxySearch.addStrategy(Strategy.JAVA);
} else if (PlatformUtil.getCurrentPlattform() == Platform.LINUX) {
proxySearch.addStrategy(Strategy.GNOME);
proxySearch.addStrategy(Strategy.KDE);
proxySearch.addStrategy(Strategy.FIREFOX);
} else {
proxySearch.addStrategy(Strategy.OS_DEFAULT);
}
```
###Improving PAC performance
When your system uses a proxy automation script (PAC) Javascript is used to determine the actual proxy.
If your program needs to access a lot of HTTP URLs, then this might become a performance bottleneck.
To speed things up a little bit, you can activate a cache that will store already processed URLs.
When a cached URL is accessed the Javascript execution will be skipped and the cached proxy is used.
```Java
// Use the static factory method getDefaultProxySearch to create a proxy search instance
// configured with the default proxy search strategies for the current environment.
ProxySearch proxySearch = ProxySearch.getDefaultProxySearch();
// Cache 20 hosts for up to 10 minutes. This is the default.
proxySearch.setPacCacheSettings(20, 1000*60*5, CacheScope.CACHE_SCOPE_HOST);
```
###How to handle proxy authentication
Some proxy servers request a login from the user before they will allow any connections. Proxy Vole
has no support to handle this automatically. This needs to be done manually, because there is no way to read
the login and password. These settings are stored encrypted. You need to install an authenticator in your Java
program manually and e.g. ask the user in a dialog to enter the username and password.
```Java
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
if (getRequestorType() == RequestorType.PROXY) {
return new PasswordAuthentication("proxy-user", "proxy-password".toCharArray());
} else {
return super.getPasswordAuthentication();
}
}
});
```
###Choose the right proxy
Please be aware a Java ProxySelector returns a list of valid proxies for a given URL and sometimes simply
choosing the first one is not good enough. Very often a check of the supported protocol is neccessary.
The following code chooses the first HTTP/S proxy.
```Java
Proxy proxy = Proxy.NO_PROXY;
// Get list of proxies from default ProxySelector available for given URL
List proxies = null;
if (ProxySelector.getDefault() != null) {
proxies = ProxySelector.getDefault().select(uri);
}
// Find first proxy for HTTP/S. Any DIRECT proxy in the list returned is only second choice
if (proxies != null) {
loop: for (Proxy p : proxies) {
switch (p.type()) {
case HTTP:
proxy = p;
break loop;
case DIRECT:
proxy = p;
break;
}
}
}
```
###Logging
Proxy Vole does not use Log4J, LogBack or SLF4J to make the library as light weight as possible with no external dependencies.
If you need to know what is going on inside of the library you may want to install a logger.
```Java
// Register MyLogger instance
Logger.setBackend(new MyLogger());
```
###Testing PAC
Testing the PAC parser can be problematic, because the myIPAddress() method returns different results on different machines.
Therefore the system property com.github.markusbernhardt.proxy.pac.overrideLocalIP can be set for unit tests.
It's value will always be used as myIPAddress in all PAC scripts.
```Java
System.setProperty(PacScriptMethods.OVERRIDE_LOCAL_IP, "123.123.123.123");
```
###Proxy Vole Tester
There is also a small GUI to test the different search strategies. Simply start the [jar-with-dependencies](http://search.maven.org/remotecontent?filepath=com/github/markusbernhardt/proxy-vole/1.0.1/proxy-vole-1.0.1-jar-with-dependencies.jar)
or directly the class `com.github.markusbernhardt.proxy.ui.ProxyTester`.

##Motivation
Today more and more applications try to take direct advantage of Internet connectivity and web services to bring web content
to your desktop. Java has very good network and Internet connectivity with build in APIs for HTTP, HTTPS, FTP and a web services stack.
But the first thing that you need, to use all this fantastic technology, is a working Internet connection. And this is where Java
lacks a lot in my opinion. When you develop an applet or an Java Webstart application the situation is quite good. The Java
Plugin will use the proxy settings and connections as used by the browser, but for standalone applications the situation is
quite unsatisfactory. You have to ask your users to twiddle with system properties and every Java application has
it's own way of setting proxy configurations. In business environments where you often can find proxy configuration scripts you are stuck.
##Current Situation
To set the proxy settings in Java you can use some (documented, but hard to find) system properties on application startup.
At runtime you can use the `ProxySelector` API to configure the proxy settings. Java even comes with a system property to
detect the system proxy settings automatically, but this one is poorly documented and unreliable in its behaviour.
##The Solution
Use the Proxy Vole library to provide network connectivity out of the box for your Java application. It provides strategies
for auto detecting the current proxy settings. There are many configurable strategies to choose from. At the moment Proxy Vole
supports the following proxy detection strategies.
* Read platform settings (Supports: Windows, KDE, Gnome, OSX)
* Read browser setting (Supports: Firefox 3.x+, Internet Explorer; Chrome and Webkit use the platform settings)
* Read environment variables (often used variables on Linux / Unix server systems)
* Auto detection script by using WPAD/PAC (Not all variations supported)
proxy-vole-proxy-vole-1.0.3/pom.xml 0000664 0000000 0000000 00000021020 13026622520 0017267 0 ustar 00root root 0000000 0000000 4.0.0org.sonatype.ossoss-parent9com.github.markusbernhardtproxy-vole1.0.3Proxy VoleProxy Vole is a Java library to auto detect the platform network proxy settings.https://github.com/MarkusBernhardt/proxy-voleUTF-8truetrue1.6https://github.com/MarkusBernhardt/proxy-volescm:git://github.com/MarkusBernhardt/proxy-vole.gitscm:git:ssh://git@github.com/MarkusBernhardt/proxy-vole.gitThe Apache Software License, Version 2.0http://www.apache.org/licenses/LICENSE-2.0.txtrepoMarkus Bernhardtmarkus.bernhardt@me.comorg.ini4jini4jnet.java.dev.jnajnanet.java.dev.jnajna-platformjunitjunittestorg.ini4jini4j0.5.4net.java.dev.jnajna4.2.2net.java.dev.jnajna-platform4.2.2junitjunit4.12org.apache.maven.pluginsmaven-deploy-plugin2.8.2org.apache.maven.pluginsmaven-compiler-plugin3.5.1${java.version}${java.version}${project.build.sourceEncoding}truetruejavacorg.apache.maven.pluginsmaven-eclipse-plugin2.10${downloadSources}${downloadJavadocs}org.apache.maven.pluginsmaven-jar-plugin2.6truetrueorg.apache.maven.pluginsmaven-source-plugin3.0.0jarverifyjarorg.apache.maven.pluginsmaven-javadoc-plugin2.10.3jarverifyjarorg.apache.maven.pluginsmaven-assembly-plugin2.6jar-with-dependenciescom.github.markusbernhardt.proxy.ui.ProxyTestermake-assemblypackagesingleorg.eclipse.m2elifecycle-mapping1.0.0org.apache.maven.pluginsmaven-enforcer-plugin[1.0.0,)enforce
proxy-vole-proxy-vole-1.0.3/src/ 0000775 0000000 0000000 00000000000 13026622520 0016546 5 ustar 00root root 0000000 0000000 proxy-vole-proxy-vole-1.0.3/src/doc/ 0000775 0000000 0000000 00000000000 13026622520 0017313 5 ustar 00root root 0000000 0000000 proxy-vole-proxy-vole-1.0.3/src/doc/PacIPv6.txt 0000664 0000000 0000000 00000000346 13026622520 0021267 0 ustar 00root root 0000000 0000000
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 proxy-vole-proxy-vole-1.0.3/src/doc/internet_explorer_info.txt 0000664 0000000 0000000 00000000365 13026622520 0024643 0 ustar 00root root 0000000 0000000
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/ proxy-vole-proxy-vole-1.0.3/src/doc/mac_osx.txt 0000664 0000000 0000000 00000000317 13026622520 0021506 0 ustar 00root root 0000000 0000000 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
proxy-vole-proxy-vole-1.0.3/src/doc/misc_links.txt 0000664 0000000 0000000 00000000212 13026622520 0022202 0 ustar 00root root 0000000 0000000
Oracle iPlanet Web Proxy Server
--------------------------------
http://download.oracle.com/docs/cd/E21692_01/821-1882/adyrr/index.html
proxy-vole-proxy-vole-1.0.3/src/doc/pac_files_docu.html 0000664 0000000 0000000 00000115457 13026622520 0023155 0 ustar 00root root 0000000 0000000
Proxy Client Autoconfig File Format
Navigator Proxy Auto-Config File Format
March 1996
(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:
url
the full URL being accessed.
host
the hostname extracted from the URL. This is only for convenience, it is
the exact same string as between :// and the first :
or / after that. The port number is not included in this parameter.
It can be extracted from the URL when necessary.
ret
(the return value) a string describing the configuration. The format of
this string is defined below.
Saving the Auto-Config File
Setting the MIME Type
You should save the JavaScript function to file with a
.pac filename
extension; for example:
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).
Next, you should configure your server to map the
.pac filename
extension to the MIME type:
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.
Return Value Format
The JavaScript function returns a single string.
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:
DIRECT
Connections should be made directly, without any proxies.
PROXY host:port
The specified proxy should be used.
SOCKS host:port
The specified SOCKS server should be used.
If there are multiple semicolon-separated settings, the left-most setting
will be used, until the Navigator fails to establish the connection to
the proxy. In that case the next value will be used, etc.
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).
Primary proxy is w3proxy:8080; if that goes down start using mozilla:8081
until the primary proxy comes up again.
PROXY w3proxy.netscape.com:8080; PROXY mozilla.netscape.com:8081; DIRECT
Same as above, but if both proxies go down, automatically start making
direct connections. (In the first example above, Netscape will ask user
confirmation about making direct connections; in this third case, there
is no user intervention.)
PROXY w3proxy.netscape.com:8080; SOCKS socks:1080
Use SOCKS if the primary proxy goes down.
Predefined Functions and Environment for the JavaScript Function
There is one associative array already defined (because a JavaScript currently
cannot define them on its own):
ProxyConfig.bindings
isPlainHostName(host)
host
the hostname from the URL (excluding port number).
True iff there is no domain name in the hostname (no dots).
Examples:
isPlainHostName("www")
is true.
isPlainHostName("www.netscape.com")
is false.
dnsDomainIs(host, domain)
host
is the hostname from the URL.
domain
is the domain name to test the hostname against.
Returns true iff the domain of hostname matches.
Examples:
dnsDomainIs("www.netscape.com", ".netscape.com")
is true.
dnsDomainIs("www", ".netscape.com")
is false.
dnsDomainIs("www.mcom.com", ".netscape.com")
is false.
localHostOrDomainIs(host, hostdom)
host
the hostname from the URL.
hostdom
fully qualified hostname to match against.
Is true if the hostname matches exactly the specified hostname, or if there
is no domain name part in the hostname, but the unqualified hostname matches.
Only the first parameter is mandatory. Either the second, the third, or
both may be left out.
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.
Examples:
weekdayRange("MON", "FRI")
true Monday trhough Friday (local timezone).
weekdayRange("MON", "FRI", "GMT")
same as above, but GMT timezone.
weekdayRange("SAT")
true on Saturdays local time.
weekdayRange("SAT", "GMT")
true on Saturdays GMT time.
weekdayRange("FRI", "MON")
true Friday through Monday (note, order does matter!).
is the day of month between 1 and 31 (as an integer).
month
is one of the month strings:
JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
year
is the full year number, for example 1995 (but not 95). Integer.
gmt
is either the string "GMT", which makes time comparison occur
in GMT timezone; if left unspecified, times are taken to be in the local
timezone.
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.
If only a single value is specified (from each category: day, month, year),
the function returns a true value only on days that match that specification.
If both values are specified, the result is true between those times, including
bounds.
Examples:
dateRange(1)
true on the first day of each month, local timezone.
dateRange(1, "GMT")
true on the first day of each month, GMT timezone.
dateRange(1, 15)
true on the first half of each month.
dateRange(24, "DEC")
true on 24th of December each year.
dateRange(24, "DEC", 1995)
true on 24th of December, 1995.
dateRange("JAN", "MAR")
true on the first quarter of the year.
dateRange(1, "JUN", 15, "AUG")
true from June 1st until August 15th, each year (including June 1st and
August 15th).
dateRange(1, "JUN", 15, 1995, "AUG", 1995)
true from June 1st, 1995, until August 15th, same year.
dateRange("OCT", 1995, "MAR", 1996)
true from October 1995 until March 1996 (including the entire month of
October 1995 and March 1996).
dateRange(1995)
true during the entire year 1995.
dateRange(1995, 1997)
true from beginning of year 1995 until the end of year 1997.
is the hour from 0 to 23. (0 is midnight, 23 is 11 pm.)
min
minutes from 0 to 59.
sec
seconds from 0 to 59.
gmt
either the string "GMT" for GMT timezone, or not specified, for
local timezone. Again, even though the above list doesn't show it, this
parameter may be present in each of the different parameter profiles, always
as the last parameter.
True during (or between) the specified time(s).
Examples:
timerange(12)
true from noon to 1pm.
timerange(12, 13)
same as above.
timerange(12, "GMT")
true from noon to 1pm, in GMT timezone.
timerange(9, 17)
true from 9am to 5pm.
timerange(8, 30, 17, 00)
true from 8:30am to 5:00pm.
timerange(0, 0, 0, 0, 0, 30)
true between midnight and 30 seconds past midnight.
Example #1:
Use proxy for everything except local hosts
This would work in Netscape's environment. All hosts which aren't fully
qualified, or the ones that are in local domain, will be connected to directly.
Everything else will go through
w3proxy:8080. If the proxy goes
down, connections become automatically direct.
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.
Example #1b:
As above, but use proxy for local servers which
are outside the firewall
If there are hosts (such as the main Web server) that belong to the local
domain but are outside the firewall, and are only reachable through the
proxy server, those exceptions can be handled using the
localHostOrDomainIs()
function:
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.
Example #2:
Use proxy only if cannot resolve host
This example would work in an environment where internal DNS is set up
so that it can only resolve internal host names, and the goal is to use
a proxy only for hosts which aren't resolvable:
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";
}
Example #3:
Subnet based decisions
In this example all the hosts in a given subnet are connected to directly,
others through the proxy.
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";
}
Example #4:
Load balancing/routing based on URL patterns
This example is more sophisticated. There are four (4) proxy servers; one
of them is a hot stand-by for all of the other ones, so if any of the remaining
three goes down, the fourth one will take over.
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.
Example #5:
Setting a proxy for a specific protocol
Most of the standard JavaScript functionality is available for use in the
FindProxyForURL()
function. As an example, to set different proxies based on the protocol,
the substring() function can be used:
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;
}
...
Tips
The autoconfig file can be output by a CGI script. This is useful e.g.
when making the autoconfig file act differently based on the client IP
address (the REMOTE_ADDR environment variable in CGI).
Use of isInNet(), isResolvable() and
dnsResolve()
functions should be carefully considered, as they require DNS server to
be consulted (whereas all other autoconfig related functions are mere string
matching functions). If a proxy is used, the proxy will perform its own
DNS lookup which would double the impact on the DNS server. Most of the
time these functions are not necessary to achieve the desired result.