org.littleshoot.proxy
Interface HttpProxyServerBootstrap


public interface HttpProxyServerBootstrap

Configures and starts an HttpProxyServer. The HttpProxyServer is built using start(). Sensible defaults are available for all parameters such that start() could be called immediately if you wish.


Method Summary
 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)
           Specify whether or not to listen on all interfaces.
 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 withPort(int port)
           Listen for incoming connections on the given port.
 HttpProxyServerBootstrap withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)
           Specify a ProxyAuthenticator to use for doing basic HTTP authentication of clients.
 HttpProxyServerBootstrap withSslEngineSource(SslEngineSource sslEngineSource)
           Specify an SslEngineSource to use for encrypting inbound connections.
 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.
 

Method Detail

withName

HttpProxyServerBootstrap withName(String name)

Give the server a name (used for naming threads, useful for logging).

Default = LittleProxy

Parameters:
name -
Returns:

withTransportProtocol

HttpProxyServerBootstrap withTransportProtocol(TransportProtocol transportProtocol)

Specify the TransportProtocol to use for incoming connections.

Default = TCP

Parameters:
transportProtocol -
Returns:

withAddress

HttpProxyServerBootstrap withAddress(InetSocketAddress address)

Listen for incoming connections on the given address.

Default = [bound ip]:8080

Parameters:
address -
Returns:

withPort

HttpProxyServerBootstrap withPort(int port)

Listen for incoming connections on the given port.

Default = 8080

Parameters:
port -
Returns:

withAllowLocalOnly

HttpProxyServerBootstrap withAllowLocalOnly(boolean allowLocalOnly)

Specify whether or not to only allow local connections.

Default = true

Parameters:
allowLocalOnly -
Returns:

withListenOnAllAddresses

HttpProxyServerBootstrap withListenOnAllAddresses(boolean listenOnAllAddresses)

Specify whether or not to listen on all interfaces.

Default = false

Parameters:
listenOnAllAddresses -
Returns:

withSslEngineSource

HttpProxyServerBootstrap withSslEngineSource(SslEngineSource sslEngineSource)

Specify an SslEngineSource to use for encrypting inbound connections.

Default = null

Parameters:
sslEngineSource -
Returns:

withAuthenticateSslClients

HttpProxyServerBootstrap withAuthenticateSslClients(boolean authenticateSslClients)

Specify whether or not to authenticate inbound SSL clients (only applies if withSslEngineSource(SslEngineSource) has been set).

Default = true

Parameters:
authenticateSslClients -
Returns:

withProxyAuthenticator

HttpProxyServerBootstrap withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)

Specify a ProxyAuthenticator to use for doing basic HTTP authentication of clients.

Default = null

Parameters:
proxyAuthenticator -
Returns:

withChainProxyManager

HttpProxyServerBootstrap withChainProxyManager(ChainedProxyManager chainProxyManager)

Specify a ChainedProxyManager to use for chaining requests to another proxy.

Default = null

Note - This and withManInTheMiddle(MitmManager) are currently mutually exclusive.

Parameters:
chainProxyManager -
Returns:

withManInTheMiddle

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 withChainProxyManager(ChainedProxyManager) are currently mutually exclusive.

Parameters:
mitmManager -
Returns:

withFiltersSource

HttpProxyServerBootstrap withFiltersSource(HttpFiltersSource filtersSource)

Specify a HttpFiltersSource to use for filtering requests and/or responses through this proxy.

Default = null

Parameters:
filtersSource -
Returns:

withUseDnsSec

HttpProxyServerBootstrap withUseDnsSec(boolean useDnsSec)

Specify whether or not to use secure DNS lookups for outbound connections.

Default = false

Parameters:
useDnsSec -
Returns:

withTransparent

HttpProxyServerBootstrap withTransparent(boolean transparent)

Specify whether or not to run this proxy as a transparent proxy.

Default = false

Parameters:
transparent -
Returns:

withIdleConnectionTimeout

HttpProxyServerBootstrap withIdleConnectionTimeout(int idleConnectionTimeout)

Specify the timeout after which to disconnect idle connections, in seconds.

Default = 70

Parameters:
idleConnectionTimeout -
Returns:

withConnectTimeout

HttpProxyServerBootstrap withConnectTimeout(int connectTimeout)

Specify the timeout for connecting to the upstream server on a new connection, in milliseconds.

Default = 40000

Parameters:
connectTimeout -
Returns:

plusActivityTracker

HttpProxyServerBootstrap plusActivityTracker(ActivityTracker activityTracker)

Add an ActivityTracker for tracking activity in this proxy.

Parameters:
activityTracker -
Returns:

start

HttpProxyServer start()

Build and starts the server.

Returns:
the newly built and started server


Copyright © 2009-2014 LittleShoot. All Rights Reserved.