org.littleshoot.proxy
Class DefaultHttpProxyServer

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

public class DefaultHttpProxyServer
extends Object
implements HttpProxyServer

HTTP proxy server.


Constructor Summary
DefaultHttpProxyServer(int port)
          Creates a new proxy server.
DefaultHttpProxyServer(int port, HttpRequestFilter requestFilter, Map<String,HttpFilter> responseFilters)
          Creates a new proxy server.
DefaultHttpProxyServer(int port, Map<String,HttpFilter> filters)
           
DefaultHttpProxyServer(int port, Map<String,HttpFilter> filters, String chainProxyHostAndPort, KeyStoreManager ksm, HttpRequestFilter requestFilter)
          Creates a new proxy server.
 
Method Summary
 void addProxyAuthenticationHandler(ProxyAuthorizationHandler pah)
          Adds a new handler for proxy authentication.
 KeyStoreManager getKeyStoreManager()
           
 void start()
          Starts the server.
 void start(boolean localOnly, boolean anyAddress)
          Starts the server.
 void stop()
          Stops the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpProxyServer

public DefaultHttpProxyServer(int port)
Creates a new proxy server.

Parameters:
port - The port the server should run on.

DefaultHttpProxyServer

public DefaultHttpProxyServer(int port,
                              Map<String,HttpFilter> filters)

DefaultHttpProxyServer

public DefaultHttpProxyServer(int port,
                              HttpRequestFilter requestFilter,
                              Map<String,HttpFilter> responseFilters)
Creates a new proxy server.

Parameters:
port - The port the server should run on.
requestFilter - The filter for HTTP requests.
responseFilters - HTTP filters to apply.

DefaultHttpProxyServer

public DefaultHttpProxyServer(int port,
                              Map<String,HttpFilter> filters,
                              String chainProxyHostAndPort,
                              KeyStoreManager ksm,
                              HttpRequestFilter requestFilter)
Creates a new proxy server.

Parameters:
port - The port the server should run on.
filters - HTTP filters to apply.
Method Detail

start

public void start()
Description copied from interface: HttpProxyServer
Starts the server.

Specified by:
start in interface HttpProxyServer

start

public void start(boolean localOnly,
                  boolean anyAddress)
Description copied from interface: HttpProxyServer
Starts the server.

Specified by:
start in interface HttpProxyServer
Parameters:
localOnly - If true, the server will only allow connections from the local computer. This can significantly improve security in some cases.
anyAddress - Whether or not to bind to "any" address - 0.0.0.0. This is the default.

stop

public void stop()
Description copied from interface: HttpProxyServer
Stops the server.

Specified by:
stop in interface HttpProxyServer

addProxyAuthenticationHandler

public void addProxyAuthenticationHandler(ProxyAuthorizationHandler pah)
Description copied from interface: HttpProxyServer
Adds a new handler for proxy authentication. Handlers are called in the order they're added. If one handler accepts the user's credentials, it passes them on to the next handler.

Specified by:
addProxyAuthenticationHandler in interface HttpProxyServer
Parameters:
pah - The new authentication handler.

getKeyStoreManager

public KeyStoreManager getKeyStoreManager()


Copyright © 2009-2011 LittleShoot. All Rights Reserved.