public interface HttpProxyServerBootstrap
HttpProxyServer
. The HttpProxyServer is
built using start()
. Sensible defaults are available for all
parameters such that start()
could be called immediately if you
wish.Modifier and Type | Method and Description |
---|---|
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
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.
use
withNetworkInterface(InetSocketAddress) to avoid listening on all local addresses |
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.
|
HttpProxyServerBootstrap withName(String name)
Give the server a name (used for naming threads, useful for logging).
Default = LittleProxy
name
- HttpProxyServerBootstrap withTransportProtocol(TransportProtocol transportProtocol)
Specify the TransportProtocol
to use for incoming connections.
Default = TCP
transportProtocol
- HttpProxyServerBootstrap withAddress(InetSocketAddress address)
Listen for incoming connections on the given address.
Default = [bound ip]:8080
address
- HttpProxyServerBootstrap withPort(int port)
Listen for incoming connections on the given port.
Default = 8080
port
- HttpProxyServerBootstrap withAllowLocalOnly(boolean allowLocalOnly)
Specify whether or not to only allow local connections.
Default = true
allowLocalOnly
- @Deprecated HttpProxyServerBootstrap withListenOnAllAddresses(boolean listenOnAllAddresses)
withNetworkInterface(InetSocketAddress)
to avoid listening on all local addressesHttpProxyServerBootstrap withSslEngineSource(SslEngineSource sslEngineSource)
Specify an SslEngineSource
to use for encrypting inbound
connections. Enabling this will enable SSL client authentication
by default (see withAuthenticateSslClients(boolean)
)
Default = null
Note - This and withManInTheMiddle(MitmManager)
are
mutually exclusive.
sslEngineSource
- HttpProxyServerBootstrap withAuthenticateSslClients(boolean authenticateSslClients)
Specify whether or not to authenticate inbound SSL clients (only applies
if withSslEngineSource(SslEngineSource)
has been set).
Default = true
authenticateSslClients
- HttpProxyServerBootstrap withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)
Specify a ProxyAuthenticator
to use for doing basic HTTP
authentication of clients.
Default = null
proxyAuthenticator
- HttpProxyServerBootstrap withChainProxyManager(ChainedProxyManager chainProxyManager)
Specify a ChainedProxyManager
to use for chaining requests to
another proxy.
Default = null
chainProxyManager
- HttpProxyServerBootstrap withManInTheMiddle(MitmManager mitmManager)
Specify an MitmManager
to use for making this proxy act as an SSL
man in the middle
Default = null
Note - This and withSslEngineSource(SslEngineSource)
are
mutually exclusive.
mitmManager
- HttpProxyServerBootstrap withFiltersSource(HttpFiltersSource filtersSource)
Specify a HttpFiltersSource
to use for filtering requests and/or
responses through this proxy.
Default = null
filtersSource
- HttpProxyServerBootstrap withUseDnsSec(boolean useDnsSec)
Specify whether or not to use secure DNS lookups for outbound connections.
Default = false
useDnsSec
- HttpProxyServerBootstrap withTransparent(boolean transparent)
Specify whether or not to run this proxy as a transparent proxy.
Default = false
transparent
- HttpProxyServerBootstrap withIdleConnectionTimeout(int idleConnectionTimeout)
Specify the timeout after which to disconnect idle connections, in seconds.
Default = 70
idleConnectionTimeout
- HttpProxyServerBootstrap withConnectTimeout(int connectTimeout)
Specify the timeout for connecting to the upstream server on a new connection, in milliseconds.
Default = 40000
connectTimeout
- HttpProxyServerBootstrap withServerResolver(HostResolver serverResolver)
HostResolver
for resolving server addresses.resolver
- HttpProxyServerBootstrap plusActivityTracker(ActivityTracker activityTracker)
Add an ActivityTracker
for tracking activity in this proxy.
activityTracker
- HttpProxyServerBootstrap withThrottling(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond)
Specify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
readThrottleBytesPerSecond
- writeThrottleBytesPerSecond
- HttpProxyServerBootstrap withNetworkInterface(InetSocketAddress inetSocketAddress)
inetSocketAddress
- to be used for outgoing communicationHttpProxyServerBootstrap withProxyAlias(String alias)
alias
- the pseudonym to add to Via headersHttpProxyServer start()
Build and starts the server.
HttpProxyServerBootstrap withThreadPoolConfiguration(ThreadPoolConfiguration configuration)
configuration
- thread pool configurationCopyright © 2009–2019 LittleShoot. All rights reserved.