private static class DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap extends Object implements HttpProxyServerBootstrap
Modifier and Type | Field and Description |
---|---|
private Collection<ActivityTracker> |
activityTrackers |
private boolean |
allowLocalOnly |
private boolean |
authenticateSslClients |
private ChainedProxyManager |
chainProxyManager |
private int |
clientToProxyAcceptorThreads |
private int |
clientToProxyWorkerThreads |
private int |
connectTimeout |
private HttpFiltersSource |
filtersSource |
private int |
idleConnectionTimeout |
private InetSocketAddress |
localAddress |
private MitmManager |
mitmManager |
private String |
name |
private int |
port |
private String |
proxyAlias |
private ProxyAuthenticator |
proxyAuthenticator |
private int |
proxyToServerWorkerThreads |
private long |
readThrottleBytesPerSecond |
private InetSocketAddress |
requestedAddress |
private ServerGroup |
serverGroup |
private HostResolver |
serverResolver |
private SslEngineSource |
sslEngineSource |
private boolean |
transparent |
private TransportProtocol |
transportProtocol |
private long |
writeThrottleBytesPerSecond |
Modifier | Constructor and Description |
---|---|
private |
DefaultHttpProxyServerBootstrap() |
private |
DefaultHttpProxyServerBootstrap(Properties props) |
private |
DefaultHttpProxyServerBootstrap(ServerGroup serverGroup,
TransportProtocol transportProtocol,
InetSocketAddress requestedAddress,
SslEngineSource sslEngineSource,
boolean authenticateSslClients,
ProxyAuthenticator proxyAuthenticator,
ChainedProxyManager chainProxyManager,
MitmManager mitmManager,
HttpFiltersSource filtersSource,
boolean transparent,
int idleConnectionTimeout,
Collection<ActivityTracker> activityTrackers,
int connectTimeout,
HostResolver serverResolver,
long readThrottleBytesPerSecond,
long writeThrottleBytesPerSecond,
InetSocketAddress localAddress,
String proxyAlias) |
Modifier and Type | Method and Description |
---|---|
private DefaultHttpProxyServer |
build() |
private InetSocketAddress |
determineListenAddress() |
HttpProxyServerBootstrap |
plusActivityTracker(ActivityTracker activityTracker)
Add an
ActivityTracker for tracking activity in this proxy. |
HttpProxyServer |
start()
Build and starts the server.
|
HttpProxyServerBootstrap |
withAddress(InetSocketAddress address)
Listen for incoming connections on the given address.
|
HttpProxyServerBootstrap |
withAllowLocalOnly(boolean allowLocalOnly)
Specify whether or not to only allow local connections.
|
HttpProxyServerBootstrap |
withAuthenticateSslClients(boolean authenticateSslClients)
Specify whether or not to authenticate inbound SSL clients (only applies
if
HttpProxyServerBootstrap.withSslEngineSource(SslEngineSource) has been set). |
HttpProxyServerBootstrap |
withChainProxyManager(ChainedProxyManager chainProxyManager)
Specify a
ChainedProxyManager to use for chaining requests to
another proxy. |
HttpProxyServerBootstrap |
withConnectTimeout(int connectTimeout)
Specify the timeout for connecting to the upstream server on a new
connection, in milliseconds.
|
HttpProxyServerBootstrap |
withFiltersSource(HttpFiltersSource filtersSource)
Specify a
HttpFiltersSource to use for filtering requests and/or
responses through this proxy. |
HttpProxyServerBootstrap |
withIdleConnectionTimeout(int idleConnectionTimeout)
Specify the timeout after which to disconnect idle connections, in
seconds.
|
HttpProxyServerBootstrap |
withListenOnAllAddresses(boolean listenOnAllAddresses)
Deprecated.
|
HttpProxyServerBootstrap |
withManInTheMiddle(MitmManager mitmManager)
Specify an
MitmManager to use for making this proxy act as an SSL
man in the middle |
HttpProxyServerBootstrap |
withName(String name)
Give the server a name (used for naming threads, useful for logging).
|
HttpProxyServerBootstrap |
withNetworkInterface(InetSocketAddress inetSocketAddress)
All outgoing-communication of the proxy-instance is goin' to be routed via the given network-interface
|
HttpProxyServerBootstrap |
withPort(int port)
Listen for incoming connections on the given port.
|
HttpProxyServerBootstrap |
withProxyAlias(String alias)
Sets the alias to use when adding Via headers to incoming and outgoing HTTP messages.
|
HttpProxyServerBootstrap |
withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)
Specify a
ProxyAuthenticator to use for doing basic HTTP
authentication of clients. |
HttpProxyServerBootstrap |
withServerResolver(HostResolver serverResolver)
Specify a custom
HostResolver for resolving server addresses. |
HttpProxyServerBootstrap |
withSslEngineSource(SslEngineSource sslEngineSource)
Specify an
SslEngineSource to use for encrypting inbound
connections. |
HttpProxyServerBootstrap |
withThreadPoolConfiguration(ThreadPoolConfiguration configuration)
Set the configuration parameters for the proxy's thread pools.
|
HttpProxyServerBootstrap |
withThrottling(long readThrottleBytesPerSecond,
long writeThrottleBytesPerSecond)
Specify the read and/or write bandwidth throttles for this proxy server.
|
HttpProxyServerBootstrap |
withTransparent(boolean transparent)
Specify whether or not to run this proxy as a transparent proxy.
|
HttpProxyServerBootstrap |
withTransportProtocol(TransportProtocol transportProtocol)
Specify the
TransportProtocol to use for incoming connections. |
HttpProxyServerBootstrap |
withUseDnsSec(boolean useDnsSec)
Specify whether or not to use secure DNS lookups for outbound
connections.
|
private String name
private ServerGroup serverGroup
private TransportProtocol transportProtocol
private InetSocketAddress requestedAddress
private int port
private boolean allowLocalOnly
private SslEngineSource sslEngineSource
private boolean authenticateSslClients
private ProxyAuthenticator proxyAuthenticator
private ChainedProxyManager chainProxyManager
private MitmManager mitmManager
private HttpFiltersSource filtersSource
private boolean transparent
private int idleConnectionTimeout
private Collection<ActivityTracker> activityTrackers
private int connectTimeout
private HostResolver serverResolver
private long readThrottleBytesPerSecond
private long writeThrottleBytesPerSecond
private InetSocketAddress localAddress
private String proxyAlias
private int clientToProxyAcceptorThreads
private int clientToProxyWorkerThreads
private int proxyToServerWorkerThreads
private DefaultHttpProxyServerBootstrap()
private DefaultHttpProxyServerBootstrap(ServerGroup serverGroup, TransportProtocol transportProtocol, InetSocketAddress requestedAddress, SslEngineSource sslEngineSource, boolean authenticateSslClients, ProxyAuthenticator proxyAuthenticator, ChainedProxyManager chainProxyManager, MitmManager mitmManager, HttpFiltersSource filtersSource, boolean transparent, int idleConnectionTimeout, Collection<ActivityTracker> activityTrackers, int connectTimeout, HostResolver serverResolver, long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond, InetSocketAddress localAddress, String proxyAlias)
private DefaultHttpProxyServerBootstrap(Properties props)
public HttpProxyServerBootstrap withName(String name)
HttpProxyServerBootstrap
Give the server a name (used for naming threads, useful for logging).
Default = LittleProxy
withName
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withTransportProtocol(TransportProtocol transportProtocol)
HttpProxyServerBootstrap
Specify the TransportProtocol
to use for incoming connections.
Default = TCP
withTransportProtocol
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withAddress(InetSocketAddress address)
HttpProxyServerBootstrap
Listen for incoming connections on the given address.
Default = [bound ip]:8080
withAddress
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withPort(int port)
HttpProxyServerBootstrap
Listen for incoming connections on the given port.
Default = 8080
withPort
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withNetworkInterface(InetSocketAddress inetSocketAddress)
HttpProxyServerBootstrap
withNetworkInterface
in interface HttpProxyServerBootstrap
inetSocketAddress
- to be used for outgoing communicationpublic HttpProxyServerBootstrap withProxyAlias(String alias)
HttpProxyServerBootstrap
withProxyAlias
in interface HttpProxyServerBootstrap
alias
- the pseudonym to add to Via headerspublic HttpProxyServerBootstrap withAllowLocalOnly(boolean allowLocalOnly)
HttpProxyServerBootstrap
Specify whether or not to only allow local connections.
Default = true
withAllowLocalOnly
in interface HttpProxyServerBootstrap
@Deprecated public HttpProxyServerBootstrap withListenOnAllAddresses(boolean listenOnAllAddresses)
HttpProxyServerBootstrap
withListenOnAllAddresses
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withSslEngineSource(SslEngineSource sslEngineSource)
HttpProxyServerBootstrap
Specify an SslEngineSource
to use for encrypting inbound
connections. Enabling this will enable SSL client authentication
by default (see HttpProxyServerBootstrap.withAuthenticateSslClients(boolean)
)
Default = null
Note - This and HttpProxyServerBootstrap.withManInTheMiddle(MitmManager)
are
mutually exclusive.
withSslEngineSource
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withAuthenticateSslClients(boolean authenticateSslClients)
HttpProxyServerBootstrap
Specify whether or not to authenticate inbound SSL clients (only applies
if HttpProxyServerBootstrap.withSslEngineSource(SslEngineSource)
has been set).
Default = true
withAuthenticateSslClients
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)
HttpProxyServerBootstrap
Specify a ProxyAuthenticator
to use for doing basic HTTP
authentication of clients.
Default = null
withProxyAuthenticator
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withChainProxyManager(ChainedProxyManager chainProxyManager)
HttpProxyServerBootstrap
Specify a ChainedProxyManager
to use for chaining requests to
another proxy.
Default = null
withChainProxyManager
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withManInTheMiddle(MitmManager mitmManager)
HttpProxyServerBootstrap
Specify an MitmManager
to use for making this proxy act as an SSL
man in the middle
Default = null
Note - This and HttpProxyServerBootstrap.withSslEngineSource(SslEngineSource)
are
mutually exclusive.
withManInTheMiddle
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withFiltersSource(HttpFiltersSource filtersSource)
HttpProxyServerBootstrap
Specify a HttpFiltersSource
to use for filtering requests and/or
responses through this proxy.
Default = null
withFiltersSource
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withUseDnsSec(boolean useDnsSec)
HttpProxyServerBootstrap
Specify whether or not to use secure DNS lookups for outbound connections.
Default = false
withUseDnsSec
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withTransparent(boolean transparent)
HttpProxyServerBootstrap
Specify whether or not to run this proxy as a transparent proxy.
Default = false
withTransparent
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withIdleConnectionTimeout(int idleConnectionTimeout)
HttpProxyServerBootstrap
Specify the timeout after which to disconnect idle connections, in seconds.
Default = 70
withIdleConnectionTimeout
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withConnectTimeout(int connectTimeout)
HttpProxyServerBootstrap
Specify the timeout for connecting to the upstream server on a new connection, in milliseconds.
Default = 40000
withConnectTimeout
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withServerResolver(HostResolver serverResolver)
HttpProxyServerBootstrap
HostResolver
for resolving server addresses.withServerResolver
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap plusActivityTracker(ActivityTracker activityTracker)
HttpProxyServerBootstrap
Add an ActivityTracker
for tracking activity in this proxy.
plusActivityTracker
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withThrottling(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond)
HttpProxyServerBootstrap
Specify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
withThrottling
in interface HttpProxyServerBootstrap
public HttpProxyServer start()
HttpProxyServerBootstrap
Build and starts the server.
start
in interface HttpProxyServerBootstrap
public HttpProxyServerBootstrap withThreadPoolConfiguration(ThreadPoolConfiguration configuration)
HttpProxyServerBootstrap
withThreadPoolConfiguration
in interface HttpProxyServerBootstrap
configuration
- thread pool configurationprivate DefaultHttpProxyServer build()
private InetSocketAddress determineListenAddress()
Copyright © 2009–2019 LittleShoot. All rights reserved.