com.dallaway.sloppy
Class SloppyServer

java.lang.Object
  |
  +--com.dallaway.sloppy.SloppyServer

public class SloppyServer
extends java.lang.Object

Main wrapper class for starting the proxy.

Each request creates a new SlowProxyThread to process the request.

Latest version of sloppy at http://www.dallaway.com/sloppy. See RELEASE field for this version number.

The proxy can be configured via a properties file. See default.properties for a sample.

See Also:
main(java.lang.String[])

Field Summary
protected  int bps
          Bytes per second
static int DEFAULT_LISTEN_PORT
          The port we listen on by default
static java.lang.String DEFAULT_SEND_HOST
          The IP address we proxy to by default
static int DEFAULT_SEND_PORT
          The port we proxy to by default
protected  int listen_port
           
protected  Log log
          For logging events, errors and so on
static java.lang.String RELEASE
          Version of this proxy
protected  boolean running
          Is this proxy running?
protected  java.lang.String send_host
           
protected  int send_port
           
protected  boolean start_gui
           
 
Constructor Summary
SloppyServer()
          Create a new proxy server with default settings
 
Method Summary
 void go()
          Start the proxy service
static void main(java.lang.String[] args)
          Start a proxy server Usage: Sloppy [+|-gui] [configuration.properties] +gui means start with a graphical user interface (not yet implemented; will be default) -gui means do not start a GUI To override the default settings supply a configuration file.
 void setBPS(int bps)
          Set the bytes per second to simulate.
 void setLog(Log log)
          Set the log instance to use for all events and errors
 void setPort(int port)
          Set the port for listening on
 void setServerHost(java.lang.String host)
          Set the host/ip where the real server runs
 void setServerPort(int port)
          Set the port where the real server runs
 void startGUI(boolean do_start)
          Decide if we do or do not start the GUI from main()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELEASE

public static java.lang.String RELEASE
Version of this proxy

DEFAULT_LISTEN_PORT

public static int DEFAULT_LISTEN_PORT
The port we listen on by default

DEFAULT_SEND_PORT

public static int DEFAULT_SEND_PORT
The port we proxy to by default

DEFAULT_SEND_HOST

public static java.lang.String DEFAULT_SEND_HOST
The IP address we proxy to by default

listen_port

protected int listen_port

send_port

protected int send_port

send_host

protected java.lang.String send_host

bps

protected int bps
Bytes per second

log

protected Log log
For logging events, errors and so on

running

protected boolean running
Is this proxy running?

start_gui

protected boolean start_gui
Constructor Detail

SloppyServer

public SloppyServer()
Create a new proxy server with default settings
Method Detail

setLog

public void setLog(Log log)
Set the log instance to use for all events and errors
Parameters:
logger - The instance of a Log for recording events

setBPS

public void setBPS(int bps)
Set the bytes per second to simulate.
Parameters:
bps - Bytes per second

setPort

public void setPort(int port)
Set the port for listening on
Parameters:
port - The port the proxy runs on. Default is 7569

setServerPort

public void setServerPort(int port)
Set the port where the real server runs
Parameters:
port - The port to proxy to. Default is 80

startGUI

public void startGUI(boolean do_start)
Decide if we do or do not start the GUI from main()
Parameters:
do_start - True means the gui will start (default)

setServerHost

public void setServerHost(java.lang.String host)
Set the host/ip where the real server runs
Parameters:
host - The IP where the real sever runs. Default 127.0.0.1

go

public void go()
        throws java.io.IOException
Start the proxy service
Throws:
java.io.IOException - Thrown if there was any problem starting the service

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        java.lang.NumberFormatException
Start a proxy server Usage: Sloppy [+|-gui] [configuration.properties] +gui means start with a graphical user interface (not yet implemented; will be default) -gui means do not start a GUI To override the default settings supply a configuration file. See default.configuration for an example