Class WpadProxySearchStrategyWithDHPC
- java.lang.Object
-
- com.github.markusbernhardt.proxy.search.wpad.WpadProxySearchStrategyWithDHPC
-
- All Implemented Interfaces:
ProxySearchStrategy
public class WpadProxySearchStrategyWithDHPC extends java.lang.Object implements 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 Constructor Description WpadProxySearchStrategyWithDHPC()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
detectScriptUrlPerDHCP()
Uses DHCP to find the script URL.private java.lang.String
detectScriptUrlPerDNS()
Uses DNS to find the script URL.java.lang.String
getName()
Gets the printable name of the search strategy.java.net.ProxySelector
getProxySelector()
Loads the proxy settings from a PAC file.java.util.Properties
readSettings()
Loads the settings and stores them in a properties map.private DHCPMessage
SendRequest(DHCPMessage offerMessageIn)
-
-
-
Method Detail
-
getProxySelector
public java.net.ProxySelector getProxySelector() throws ProxyException
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
public java.lang.String getName()
Gets the printable name of the search strategy.- Specified by:
getName
in interfaceProxySearchStrategy
- Returns:
- the printable name of the search strategy
-
readSettings
public java.util.Properties readSettings()
Loads the settings and stores them in a properties map.- Returns:
- the settings.
-
detectScriptUrlPerDNS
private java.lang.String detectScriptUrlPerDNS() throws java.io.IOException
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:
java.io.IOException
-
detectScriptUrlPerDHCP
private java.lang.String detectScriptUrlPerDHCP()
Uses DHCP to find the script URL.- Returns:
- the URL, null if not found.
-
SendRequest
private DHCPMessage SendRequest(DHCPMessage offerMessageIn)
-
-