Class WpadProxySearchStrategy
java.lang.Object
com.github.markusbernhardt.proxy.search.wpad.WpadProxySearchStrategy
- All Implemented Interfaces:
ProxySearchStrategy
Uses automatic proxy script search (WPAD) to find an PAC file automatically.
Note: at the moment only the DNS name guessing schema is implemented. All others are missing.
For more information about WPAD: Web_Proxy_Autodiscovery_Protocol
Outdated RFC draft: draft-ietf-wrec-wpad-01.txt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
checkDhcpAckForPAC
(InetAddress ip, byte[] mac) private String
Uses DHCP to find the script URL.private String
Uses DNS to find the script URL.private String
getMacString
(byte[] mac) getName()
Gets the printable name of the search strategy.Loads the proxy settings from a PAC file.Loads the settings and stores them in a properties map.
-
Constructor Details
-
WpadProxySearchStrategy
public WpadProxySearchStrategy()Constructor
-
-
Method Details
-
getProxySelector
Loads the proxy settings from a PAC file. The location of the PAC file is determined automatically.- Specified by:
getProxySelector
in interfaceProxySearchStrategy
- Returns:
- a configured ProxySelector, null if none is found.
- Throws:
ProxyException
- on error.
-
getName
Gets the printable name of the search strategy.- Specified by:
getName
in interfaceProxySearchStrategy
- Returns:
- the printable name of the search strategy
-
readSettings
Loads the settings and stores them in a properties map.- Returns:
- the settings.
-
detectScriptUrlPerDNS
Uses DNS to find the script URL. Attention: this detection method is known to have some severe security issues.- Returns:
- the URL, null if not found.
- Throws:
IOException
-
detectScriptUrlPerDHCP
Uses DHCP to find the script URL.- Returns:
- the URL, null if not found.
- Throws:
IOException
-
getMacString
-
checkDhcpAckForPAC
- Throws:
IOException
-