BrowserMobProxy interface to preserve compatibility with future BrowserMob Proxy versions.@Deprecated public class ProxyServer extends Object implements LegacyProxyServer, BrowserMobProxy
LegacyProxyServer
interface that defines the BMP 2.0 contact, as well as the 2.1+ BrowserMobProxy interface. Important: if
you are implementing new code, use the BrowserMobProxy interface. The
LegacyProxyServer interface is deprecated and will be removed in a future release.
BrowserMobProxy operations are not supported and will be ignored:
BrowserMobProxy.getServerBindAddress() and start(int, java.net.InetAddress, java.net.InetAddress) - server bind addresses are not supportedBrowserMobProxy.stopAutoAuthorization(String)| Modifier and Type | Class and Description |
|---|---|
static class |
ProxyServer.TimeoutException
Deprecated.
Exception thrown when waitForNetworkTrafficToStop does not successfully wait for network traffic to stop.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOW_NATIVE_DNS_FALLBACK
Deprecated.
System property to allow fallback to the native Java hostname lookup mechanism when dnsjava (xbill) cannot resolve the hostname.
|
| Constructor and Description |
|---|
ProxyServer()
Deprecated.
|
ProxyServer(int port)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Deprecated.
|
void |
addFirstHttpFilterFactory(org.littleshoot.proxy.HttpFiltersSource filterFactory)
Deprecated.
|
void |
addHeader(String name,
String value)
Deprecated.
|
void |
addHeaders(Map<String,String> headers)
Deprecated.
|
void |
addLastHttpFilterFactory(org.littleshoot.proxy.HttpFiltersSource filterFactory)
Deprecated.
|
void |
addRequestFilter(RequestFilter filter)
Deprecated.
|
void |
addRequestInterceptor(org.apache.http.HttpRequestInterceptor i)
Deprecated.
|
void |
addRequestInterceptor(RequestInterceptor interceptor)
Deprecated.
|
void |
addResponseFilter(ResponseFilter filter)
Deprecated.
|
void |
addResponseInterceptor(org.apache.http.HttpResponseInterceptor i)
Deprecated.
|
void |
addResponseInterceptor(ResponseInterceptor interceptor)
Deprecated.
|
void |
addWhitelistPattern(String urlPattern)
Deprecated.
|
void |
autoAuthorization(String domain,
String username,
String password,
AuthType authType)
Deprecated.
|
void |
autoBasicAuthorization(String domain,
String username,
String password)
Deprecated.
|
void |
blacklistRequests(String pattern,
int responseCode)
Deprecated.
|
void |
blacklistRequests(String pattern,
int responseCode,
String method)
Deprecated.
|
void |
chainedProxyAuthorization(String username,
String password,
AuthType authType)
Deprecated.
|
void |
cleanSslCertificates()
Deprecated.
|
void |
cleanup()
Deprecated.
|
void |
clearBlacklist()
Deprecated.
|
void |
clearDNSCache()
Deprecated.
|
void |
clearRewriteRules()
Deprecated.
|
void |
clearWhitelist()
Deprecated.
|
void |
disableHarCaptureTypes(CaptureType... captureTypes)
Deprecated.
|
void |
disableHarCaptureTypes(Set<CaptureType> captureTypes)
Deprecated.
|
void |
disableWhitelist()
Deprecated.
|
void |
enableEmptyWhitelist(int responseCode)
Deprecated.
Enables an empty whitelist, which will return the specified responseCode for all requests.
|
void |
enableHarCaptureTypes(CaptureType... captureTypes)
Deprecated.
|
void |
enableHarCaptureTypes(Set<CaptureType> captureTypes)
Deprecated.
|
Har |
endHar()
Deprecated.
|
void |
endPage()
Deprecated.
|
Map<String,String> |
getAllHeaders()
Deprecated.
|
Collection<BlacklistEntry> |
getBlacklist()
Deprecated.
|
List<BlacklistEntry> |
getBlacklistedRequests()
Deprecated.
use getBlacklistedUrls()
|
Collection<BlacklistEntry> |
getBlacklistedUrls()
Deprecated.
|
InetSocketAddress |
getChainedProxy()
Deprecated.
|
InetAddress |
getClientBindAddress()
Deprecated.
|
InetAddress |
getConnectableLocalHost()
Deprecated.
Return a plausible
InetAddress that other processes can use to
contact the proxy. |
Har |
getHar()
Deprecated.
|
EnumSet<CaptureType> |
getHarCaptureTypes()
Deprecated.
|
AdvancedHostResolver |
getHostNameResolver()
Deprecated.
|
InetAddress |
getLocalHost()
Deprecated.
Get the the InetAddress that the Proxy server binds to when it starts.
|
int |
getPort()
Deprecated.
|
long |
getReadBandwidthLimit()
Deprecated.
|
Map<String,String> |
getRewriteRules()
Deprecated.
|
InetAddress |
getServerBindAddress()
Deprecated.
|
StreamManager |
getStreamManager()
Deprecated.
|
List<Pattern> |
getWhitelistRequests()
Deprecated.
use getWhitelistUrls()
|
int |
getWhitelistResponseCode()
Deprecated.
|
int |
getWhitelistStatusCode()
Deprecated.
|
Collection<String> |
getWhitelistUrls()
Deprecated.
|
long |
getWriteBandwidthLimit()
Deprecated.
|
boolean |
isStarted()
Deprecated.
|
boolean |
isWhitelistEnabled()
Deprecated.
|
Har |
newHar()
Deprecated.
|
Har |
newHar(String initialPageRef)
Deprecated.
|
Har |
newHar(String initialPageRef,
String initialPageTitle)
Deprecated.
|
Har |
newPage()
Deprecated.
|
Har |
newPage(String pageRef)
Deprecated.
|
Har |
newPage(String pageRef,
String pageTitle)
Deprecated.
|
void |
remapHost(String source,
String target)
Deprecated.
|
void |
removeAllHeaders()
Deprecated.
|
void |
removeHeader(String name)
Deprecated.
|
void |
removeRewriteRule(String urlPattern)
Deprecated.
|
void |
rewriteUrl(String match,
String replace)
Deprecated.
|
void |
rewriteUrls(Map<String,String> rewriteRules)
Deprecated.
|
org.openqa.selenium.Proxy |
seleniumProxy()
Deprecated.
|
void |
setBlacklist(Collection<BlacklistEntry> blacklist)
Deprecated.
|
void |
setCaptureBinaryContent(boolean captureBinaryContent)
Deprecated.
|
void |
setCaptureContent(boolean captureContent)
Deprecated.
|
void |
setCaptureHeaders(boolean captureHeaders)
Deprecated.
|
void |
setChainedProxy(InetSocketAddress chainedProxyAddress)
Deprecated.
|
void |
setConnectionTimeout(int connectionTimeout)
Deprecated.
|
void |
setConnectTimeout(int connectionTimeout,
TimeUnit timeUnit)
Deprecated.
|
void |
setDNSCacheTimeout(int timeout)
Deprecated.
|
void |
setDownstreamKbps(long downstreamKbps)
Deprecated.
|
void |
setHarCaptureTypes(CaptureType... captureTypes)
Deprecated.
|
void |
setHarCaptureTypes(Set<CaptureType> captureTypes)
Deprecated.
|
void |
setHostNameResolver(AdvancedHostResolver resolver)
Deprecated.
|
void |
setIdleConnectionTimeout(int idleConnectionTimeout,
TimeUnit timeUnit)
Deprecated.
|
void |
setLatency(long latency)
Deprecated.
|
void |
setLatency(long latency,
TimeUnit timeUnit)
Deprecated.
|
void |
setLocalHost(InetAddress localHost)
Deprecated.
|
void |
setMitmDisabled(boolean mitmDisabled)
Deprecated.
|
void |
setMitmManager(org.littleshoot.proxy.MitmManager mitmManager)
Deprecated.
|
void |
setOptions(Map<String,String> options)
Deprecated.
|
void |
setPort(int port)
Deprecated.
|
void |
setReadBandwidthLimit(long bytesPerSecond)
Deprecated.
|
void |
setRequestTimeout(int requestTimeout)
Deprecated.
|
void |
setRequestTimeout(int requestTimeout,
TimeUnit timeUnit)
Deprecated.
|
void |
setRetryCount(int count)
Deprecated.
|
void |
setSocketOperationTimeout(int readTimeout)
Deprecated.
|
void |
setTrustAllServers(boolean trustAllServers)
Deprecated.
|
void |
setTrustSource(TrustSource trustSource)
Deprecated.
|
void |
setUpstreamKbps(long upstreamKbps)
Deprecated.
|
void |
setWriteBandwidthLimit(long bytesPerSecond)
Deprecated.
|
void |
start()
Deprecated.
|
void |
start(int port)
Deprecated.
|
void |
start(int port,
InetAddress bindAddress)
Deprecated.
|
void |
start(int port,
InetAddress clientBindAddress,
InetAddress serverBindAddress)
Deprecated.
|
void |
stop()
Deprecated.
|
void |
stopAutoAuthorization(String domain)
Deprecated.
|
void |
waitForNetworkTrafficToStop(long quietPeriodInMs,
long timeoutInMs)
Deprecated.
|
boolean |
waitForQuiescence(long quietPeriod,
long timeout,
TimeUnit timeUnit)
Deprecated.
|
void |
whitelistRequests(Collection<String> urlPatterns,
int statusCode)
Deprecated.
|
void |
whitelistRequests(String[] patterns,
int responseCode)
Deprecated.
Whitelists the specified requests.
|
public static final String ALLOW_NATIVE_DNS_FALLBACK
public ProxyServer()
public ProxyServer(int port)
public void start()
start in interface BrowserMobProxystart in interface LegacyProxyServerpublic void start(int port)
start in interface BrowserMobProxypublic void start(int port,
InetAddress bindAddress)
start in interface BrowserMobProxypublic void start(int port,
InetAddress clientBindAddress,
InetAddress serverBindAddress)
start in interface BrowserMobProxypublic boolean isStarted()
isStarted in interface BrowserMobProxypublic org.openqa.selenium.Proxy seleniumProxy()
throws NameResolutionException
seleniumProxy in interface LegacyProxyServerNameResolutionExceptionpublic void cleanup()
cleanup in interface LegacyProxyServerpublic void stop()
stop in interface BrowserMobProxystop in interface LegacyProxyServerpublic void abort()
abort in interface BrowserMobProxyabort in interface LegacyProxyServerpublic InetAddress getClientBindAddress()
getClientBindAddress in interface BrowserMobProxypublic int getPort()
getPort in interface BrowserMobProxygetPort in interface LegacyProxyServerpublic InetAddress getServerBindAddress()
getServerBindAddress in interface BrowserMobProxypublic void setPort(int port)
setPort in interface LegacyProxyServerpublic InetAddress getLocalHost()
setLocalHost(InetAddress), defaults to
0.0.0.0 (i.e. bind to any interface).
Note - just because we bound to the address, doesn't mean that it can be
reached. E.g. trying to connect to 0.0.0.0 is going to fail. Use
getConnectableLocalHost() if you're looking for a host that can be
connected to.getLocalHost in interface LegacyProxyServerpublic InetAddress getConnectableLocalHost() throws UnknownHostException
InetAddress that other processes can use to
contact the proxy.
In essence, this is the same as getLocalHost(), but avoids
returning 0.0.0.0. as no-one can connect to that. If no other host has
been set via setLocalHost(InetAddress), will return
InetAddress.getLocalHost()
No attempt is made to check the address for reachability before it is
returned.getConnectableLocalHost in interface LegacyProxyServerUnknownHostExceptionpublic void setLocalHost(InetAddress localHost)
setLocalHost in interface LegacyProxyServerpublic Har getHar()
getHar in interface BrowserMobProxygetHar in interface LegacyProxyServerpublic Har newHar()
newHar in interface BrowserMobProxypublic Har newHar(String initialPageRef)
newHar in interface BrowserMobProxynewHar in interface LegacyProxyServerpublic Har newHar(String initialPageRef, String initialPageTitle)
newHar in interface BrowserMobProxynewHar in interface LegacyProxyServerpublic void setHarCaptureTypes(Set<CaptureType> captureTypes)
setHarCaptureTypes in interface BrowserMobProxypublic void setHarCaptureTypes(CaptureType... captureTypes)
setHarCaptureTypes in interface BrowserMobProxypublic EnumSet<CaptureType> getHarCaptureTypes()
getHarCaptureTypes in interface BrowserMobProxypublic void enableHarCaptureTypes(Set<CaptureType> captureTypes)
enableHarCaptureTypes in interface BrowserMobProxypublic void enableHarCaptureTypes(CaptureType... captureTypes)
enableHarCaptureTypes in interface BrowserMobProxypublic void disableHarCaptureTypes(Set<CaptureType> captureTypes)
disableHarCaptureTypes in interface BrowserMobProxypublic void disableHarCaptureTypes(CaptureType... captureTypes)
disableHarCaptureTypes in interface BrowserMobProxypublic Har newPage()
newPage in interface BrowserMobProxypublic Har newPage(String pageRef)
newPage in interface BrowserMobProxynewPage in interface LegacyProxyServerpublic Har newPage(String pageRef, String pageTitle)
newPage in interface BrowserMobProxynewPage in interface LegacyProxyServerpublic Har endHar()
endHar in interface BrowserMobProxypublic void setReadBandwidthLimit(long bytesPerSecond)
setReadBandwidthLimit in interface BrowserMobProxypublic long getReadBandwidthLimit()
getReadBandwidthLimit in interface BrowserMobProxypublic void setWriteBandwidthLimit(long bytesPerSecond)
setWriteBandwidthLimit in interface BrowserMobProxypublic long getWriteBandwidthLimit()
getWriteBandwidthLimit in interface BrowserMobProxypublic void setLatency(long latency,
TimeUnit timeUnit)
setLatency in interface BrowserMobProxypublic void setConnectTimeout(int connectionTimeout,
TimeUnit timeUnit)
setConnectTimeout in interface BrowserMobProxypublic void setIdleConnectionTimeout(int idleConnectionTimeout,
TimeUnit timeUnit)
setIdleConnectionTimeout in interface BrowserMobProxypublic void setRequestTimeout(int requestTimeout,
TimeUnit timeUnit)
setRequestTimeout in interface BrowserMobProxypublic void autoAuthorization(String domain, String username, String password, AuthType authType)
autoAuthorization in interface BrowserMobProxypublic void stopAutoAuthorization(String domain)
stopAutoAuthorization in interface BrowserMobProxypublic void chainedProxyAuthorization(String username, String password, AuthType authType)
chainedProxyAuthorization in interface BrowserMobProxypublic void endPage()
endPage in interface LegacyProxyServerpublic void setRetryCount(int count)
setRetryCount in interface LegacyProxyServerpublic void addHeaders(Map<String,String> headers)
addHeaders in interface BrowserMobProxypublic void remapHost(String source, String target)
remapHost in interface LegacyProxyServer@Deprecated public void addRequestInterceptor(org.apache.http.HttpRequestInterceptor i)
addRequestInterceptor in interface LegacyProxyServerpublic void addRequestInterceptor(RequestInterceptor interceptor)
addRequestInterceptor in interface LegacyProxyServer@Deprecated public void addResponseInterceptor(org.apache.http.HttpResponseInterceptor i)
addResponseInterceptor in interface LegacyProxyServerpublic void addResponseInterceptor(ResponseInterceptor interceptor)
addResponseInterceptor in interface LegacyProxyServerpublic StreamManager getStreamManager()
getStreamManager in interface LegacyProxyServer@Deprecated public void setDownstreamKbps(long downstreamKbps)
setDownstreamKbps in interface LegacyProxyServer@Deprecated public void setUpstreamKbps(long upstreamKbps)
setUpstreamKbps in interface LegacyProxyServer@Deprecated public void setLatency(long latency)
setLatency in interface LegacyProxyServerpublic void setRequestTimeout(int requestTimeout)
setRequestTimeout in interface LegacyProxyServerpublic void setSocketOperationTimeout(int readTimeout)
setSocketOperationTimeout in interface LegacyProxyServerpublic void setConnectionTimeout(int connectionTimeout)
setConnectionTimeout in interface LegacyProxyServerpublic void autoBasicAuthorization(String domain, String username, String password)
autoBasicAuthorization in interface LegacyProxyServerpublic void rewriteUrl(String match, String replace)
rewriteUrl in interface BrowserMobProxyrewriteUrl in interface LegacyProxyServerpublic void rewriteUrls(Map<String,String> rewriteRules)
rewriteUrls in interface BrowserMobProxypublic Map<String,String> getRewriteRules()
getRewriteRules in interface BrowserMobProxypublic void removeRewriteRule(String urlPattern)
removeRewriteRule in interface BrowserMobProxypublic void clearRewriteRules()
clearRewriteRules in interface BrowserMobProxyclearRewriteRules in interface LegacyProxyServerpublic void blacklistRequests(String pattern, int responseCode)
blacklistRequests in interface BrowserMobProxyblacklistRequests in interface LegacyProxyServerpublic void blacklistRequests(String pattern, int responseCode, String method)
blacklistRequests in interface BrowserMobProxyblacklistRequests in interface LegacyProxyServerpublic void setBlacklist(Collection<BlacklistEntry> blacklist)
setBlacklist in interface BrowserMobProxypublic Collection<BlacklistEntry> getBlacklist()
getBlacklist in interface BrowserMobProxy@Deprecated public List<BlacklistEntry> getBlacklistedRequests()
getBlacklistedRequests in interface LegacyProxyServerpublic Collection<BlacklistEntry> getBlacklistedUrls()
getBlacklistedUrls in interface LegacyProxyServerpublic boolean isWhitelistEnabled()
isWhitelistEnabled in interface BrowserMobProxyisWhitelistEnabled in interface LegacyProxyServer@Deprecated public List<Pattern> getWhitelistRequests()
getWhitelistRequests in interface LegacyProxyServerpublic Collection<String> getWhitelistUrls()
getWhitelistUrls in interface BrowserMobProxygetWhitelistUrls in interface LegacyProxyServerpublic int getWhitelistStatusCode()
getWhitelistStatusCode in interface BrowserMobProxypublic int getWhitelistResponseCode()
getWhitelistResponseCode in interface LegacyProxyServerpublic void clearBlacklist()
clearBlacklist in interface BrowserMobProxyclearBlacklist in interface LegacyProxyServerpublic void whitelistRequests(Collection<String> urlPatterns, int statusCode)
whitelistRequests in interface BrowserMobProxypublic void addWhitelistPattern(String urlPattern)
addWhitelistPattern in interface BrowserMobProxypublic void whitelistRequests(String[] patterns, int responseCode)
Note: This method overwrites any existing whitelist.
whitelistRequests in interface LegacyProxyServerpatterns - regular expression patterns matching URLs to whitelistresponseCode - response code to return for non-whitelisted URLspublic void enableEmptyWhitelist(int responseCode)
enableEmptyWhitelist in interface BrowserMobProxyenableEmptyWhitelist in interface LegacyProxyServerresponseCode - HTTP response code to return for all requestspublic void disableWhitelist()
disableWhitelist in interface BrowserMobProxypublic void clearWhitelist()
clearWhitelist in interface LegacyProxyServerpublic void addHeader(String name, String value)
addHeader in interface BrowserMobProxyaddHeader in interface LegacyProxyServerpublic void removeHeader(String name)
removeHeader in interface BrowserMobProxypublic void removeAllHeaders()
removeAllHeaders in interface BrowserMobProxypublic Map<String,String> getAllHeaders()
getAllHeaders in interface BrowserMobProxypublic void setHostNameResolver(AdvancedHostResolver resolver)
setHostNameResolver in interface BrowserMobProxypublic AdvancedHostResolver getHostNameResolver()
getHostNameResolver in interface BrowserMobProxypublic boolean waitForQuiescence(long quietPeriod,
long timeout,
TimeUnit timeUnit)
waitForQuiescence in interface BrowserMobProxypublic void setChainedProxy(InetSocketAddress chainedProxyAddress)
setChainedProxy in interface BrowserMobProxypublic InetSocketAddress getChainedProxy()
getChainedProxy in interface BrowserMobProxypublic void setCaptureHeaders(boolean captureHeaders)
setCaptureHeaders in interface LegacyProxyServerpublic void setCaptureContent(boolean captureContent)
setCaptureContent in interface LegacyProxyServerpublic void setCaptureBinaryContent(boolean captureBinaryContent)
setCaptureBinaryContent in interface LegacyProxyServerpublic void clearDNSCache()
clearDNSCache in interface LegacyProxyServerpublic void setDNSCacheTimeout(int timeout)
setDNSCacheTimeout in interface LegacyProxyServerpublic void waitForNetworkTrafficToStop(long quietPeriodInMs,
long timeoutInMs)
waitForNetworkTrafficToStop in interface LegacyProxyServerpublic void setOptions(Map<String,String> options)
setOptions in interface LegacyProxyServerpublic void addFirstHttpFilterFactory(org.littleshoot.proxy.HttpFiltersSource filterFactory)
addFirstHttpFilterFactory in interface BrowserMobProxypublic void addLastHttpFilterFactory(org.littleshoot.proxy.HttpFiltersSource filterFactory)
addLastHttpFilterFactory in interface BrowserMobProxypublic void addResponseFilter(ResponseFilter filter)
addResponseFilter in interface BrowserMobProxypublic void addRequestFilter(RequestFilter filter)
addRequestFilter in interface BrowserMobProxypublic void setMitmDisabled(boolean mitmDisabled)
setMitmDisabled in interface BrowserMobProxypublic void setMitmManager(org.littleshoot.proxy.MitmManager mitmManager)
setMitmManager in interface BrowserMobProxypublic void setTrustAllServers(boolean trustAllServers)
setTrustAllServers in interface BrowserMobProxypublic void setTrustSource(TrustSource trustSource)
setTrustSource in interface BrowserMobProxypublic void cleanSslCertificates()
Copyright © 2017. All rights reserved.