org.littleshoot.proxy.impl
Class DefaultHttpProxyServer

java.lang.Object
  extended by org.littleshoot.proxy.impl.DefaultHttpProxyServer
All Implemented Interfaces:
HttpProxyServer

public class DefaultHttpProxyServer
extends Object
implements HttpProxyServer

Primary implementation of an HttpProxyServer.

DefaultHttpProxyServer is bootstrapped by calling bootstrap() or bootstrapFromFile(String), and then calling DefaultHttpProxyServerBootstrap#start(). For example:

 DefaultHttpProxyServer server =
         DefaultHttpProxyServer
                 .bootstrap()
                 .withPort(8090)
                 .start();
 


Method Summary
static HttpProxyServerBootstrap bootstrap()
          Bootstrap a new DefaultHttpProxyServer starting from scratch.
static HttpProxyServerBootstrap bootstrapFromFile(String path)
          Bootstrap a new DefaultHttpProxyServer using defaults from the given file.
 HttpProxyServerBootstrap clone()
           Clone the existing server, with a port 1 higher and everything else the same.
protected  Collection<ActivityTracker> getActivityTrackers()
           
protected  ChainedProxyManager getChainProxyManager()
           
 int getConnectTimeout()
           
 HttpFiltersSource getFiltersSource()
           
 int getIdleConnectionTimeout()
           
 InetSocketAddress getListenAddress()
          Return the address on which this proxy is listening.
protected  MitmManager getMitmManager()
           
protected  ProxyAuthenticator getProxyAuthenticator()
           
protected  io.netty.channel.EventLoopGroup getProxyToServerWorkerFor(TransportProtocol transportProtocol)
           
protected  SslEngineSource getSslEngineSource()
           
protected  void registerChannel(io.netty.channel.Channel channel)
          Register a new Channel with this server, for later closing.
 void setIdleConnectionTimeout(int idleConnectionTimeout)
           
 void stop()
          Stops the server and all related clones.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bootstrap

public static HttpProxyServerBootstrap bootstrap()
Bootstrap a new DefaultHttpProxyServer starting from scratch.

Returns:

bootstrapFromFile

public static HttpProxyServerBootstrap bootstrapFromFile(String path)
Bootstrap a new DefaultHttpProxyServer using defaults from the given file.

Parameters:
path -
Returns:

getIdleConnectionTimeout

public int getIdleConnectionTimeout()
Specified by:
getIdleConnectionTimeout in interface HttpProxyServer

setIdleConnectionTimeout

public void setIdleConnectionTimeout(int idleConnectionTimeout)
Specified by:
setIdleConnectionTimeout in interface HttpProxyServer

getConnectTimeout

public int getConnectTimeout()

getListenAddress

public InetSocketAddress getListenAddress()
Description copied from interface: HttpProxyServer
Return the address on which this proxy is listening.

Specified by:
getListenAddress in interface HttpProxyServer
Returns:

clone

public HttpProxyServerBootstrap clone()
Description copied from interface: HttpProxyServer

Clone the existing server, with a port 1 higher and everything else the same.

The new server will share event loops with the original server. The event loops will use whatever name was given to the first server in the clone group.

Specified by:
clone in interface HttpProxyServer
Overrides:
clone in class Object
Returns:
a bootstrap that allows customizing and starting the cloned server

stop

public void stop()
Description copied from interface: HttpProxyServer
Stops the server and all related clones.

Specified by:
stop in interface HttpProxyServer

registerChannel

protected void registerChannel(io.netty.channel.Channel channel)
Register a new Channel with this server, for later closing.

Parameters:
channel -

getChainProxyManager

protected ChainedProxyManager getChainProxyManager()

getMitmManager

protected MitmManager getMitmManager()

getSslEngineSource

protected SslEngineSource getSslEngineSource()

getProxyAuthenticator

protected ProxyAuthenticator getProxyAuthenticator()

getFiltersSource

public HttpFiltersSource getFiltersSource()

getActivityTrackers

protected Collection<ActivityTracker> getActivityTrackers()

getProxyToServerWorkerFor

protected io.netty.channel.EventLoopGroup getProxyToServerWorkerFor(TransportProtocol transportProtocol)


Copyright © 2009-2014 LittleShoot. All Rights Reserved.