private static class DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap extends Object implements HttpProxyServerBootstrap
| 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,
int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean allowRequestToOriginServer) |
| 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 |
withAllowRequestToOriginServer(boolean allowRequestToOriginServer)
When true, the proxy will accept requests that appear to be directed at an origin server (i.e.
|
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 |
withMaxChunkSize(int maxChunkSize) |
HttpProxyServerBootstrap |
withMaxHeaderSize(int maxHeaderSize) |
HttpProxyServerBootstrap |
withMaxInitialLineLength(int maxInitialLineLength) |
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 int maxInitialLineLength
private int maxHeaderSize
private int maxChunkSize
private boolean allowRequestToOriginServer
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, int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean allowRequestToOriginServer)
private DefaultHttpProxyServerBootstrap(Properties props)
public HttpProxyServerBootstrap withName(String name)
HttpProxyServerBootstrapGive the server a name (used for naming threads, useful for logging).
Default = LittleProxy
withName in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withTransportProtocol(TransportProtocol transportProtocol)
HttpProxyServerBootstrap
Specify the TransportProtocol to use for incoming connections.
Default = TCP
withTransportProtocol in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withAddress(InetSocketAddress address)
HttpProxyServerBootstrapListen for incoming connections on the given address.
Default = [bound ip]:8080
withAddress in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withPort(int port)
HttpProxyServerBootstrapListen for incoming connections on the given port.
Default = 8080
withPort in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withNetworkInterface(InetSocketAddress inetSocketAddress)
HttpProxyServerBootstrapwithNetworkInterface in interface HttpProxyServerBootstrapinetSocketAddress - to be used for outgoing communicationpublic HttpProxyServerBootstrap withProxyAlias(String alias)
HttpProxyServerBootstrapwithProxyAlias in interface HttpProxyServerBootstrapalias - the pseudonym to add to Via headerspublic HttpProxyServerBootstrap withAllowLocalOnly(boolean allowLocalOnly)
HttpProxyServerBootstrapSpecify whether or not to only allow local connections.
Default = true
withAllowLocalOnly in interface HttpProxyServerBootstrap@Deprecated public HttpProxyServerBootstrap withListenOnAllAddresses(boolean listenOnAllAddresses)
HttpProxyServerBootstrapwithListenOnAllAddresses in interface HttpProxyServerBootstrappublic 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 HttpProxyServerBootstrappublic 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 HttpProxyServerBootstrappublic HttpProxyServerBootstrap withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)
HttpProxyServerBootstrap
Specify a ProxyAuthenticator to use for doing basic HTTP
authentication of clients.
Default = null
withProxyAuthenticator in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withChainProxyManager(ChainedProxyManager chainProxyManager)
HttpProxyServerBootstrap
Specify a ChainedProxyManager to use for chaining requests to
another proxy.
Default = null
withChainProxyManager in interface HttpProxyServerBootstrappublic 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 HttpProxyServerBootstrappublic HttpProxyServerBootstrap withFiltersSource(HttpFiltersSource filtersSource)
HttpProxyServerBootstrap
Specify a HttpFiltersSource to use for filtering requests and/or
responses through this proxy.
Default = null
withFiltersSource in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withUseDnsSec(boolean useDnsSec)
HttpProxyServerBootstrapSpecify whether or not to use secure DNS lookups for outbound connections.
Default = false
withUseDnsSec in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withTransparent(boolean transparent)
HttpProxyServerBootstrapSpecify whether or not to run this proxy as a transparent proxy.
Default = false
withTransparent in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withIdleConnectionTimeout(int idleConnectionTimeout)
HttpProxyServerBootstrapSpecify the timeout after which to disconnect idle connections, in seconds.
Default = 70
withIdleConnectionTimeout in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withConnectTimeout(int connectTimeout)
HttpProxyServerBootstrapSpecify the timeout for connecting to the upstream server on a new connection, in milliseconds.
Default = 40000
withConnectTimeout in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withServerResolver(HostResolver serverResolver)
HttpProxyServerBootstrapHostResolver for resolving server addresses.withServerResolver in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap plusActivityTracker(ActivityTracker activityTracker)
HttpProxyServerBootstrap
Add an ActivityTracker for tracking activity in this proxy.
plusActivityTracker in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withThrottling(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond)
HttpProxyServerBootstrapSpecify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
withThrottling in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withMaxInitialLineLength(int maxInitialLineLength)
withMaxInitialLineLength in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withMaxHeaderSize(int maxHeaderSize)
withMaxHeaderSize in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withMaxChunkSize(int maxChunkSize)
withMaxChunkSize in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withAllowRequestToOriginServer(boolean allowRequestToOriginServer)
HttpProxyServerBootstrapwithAllowRequestToOriginServer in interface HttpProxyServerBootstrapallowRequestToOriginServer - when true, the proxy will accept origin-form HTTP requestspublic HttpProxyServer start()
HttpProxyServerBootstrapBuild and starts the server.
start in interface HttpProxyServerBootstrappublic HttpProxyServerBootstrap withThreadPoolConfiguration(ThreadPoolConfiguration configuration)
HttpProxyServerBootstrapwithThreadPoolConfiguration in interface HttpProxyServerBootstrapconfiguration - thread pool configurationprivate DefaultHttpProxyServer build()
private InetSocketAddress determineListenAddress()
Copyright © 2009–2017 LittleShoot. All rights reserved.