webtester.packages.apps
Class httpProxy

java.lang.Object
  |
  +--webtester.packages.apps.httpProxy

public class httpProxy
extends java.lang.Object

Listen for HTTP requests on the specified, and act as a proxy for those requests.

Author:
Aaron DeLong

Field Summary
private static java.net.ServerSocket acceptor
          The socket which listens for browser connections.
private static boolean bEndProxy
          Indicates whether the proxy has finished recording.
private static boolean bRecord
          Indicates whether the browser is currently recording.
private static java.util.HashMap hServerTypes
          A HashMap that contains server type information.
private static int iDefaultPort
          The default port to use when waiting for connections.
private static int iSleepTime
          The amount of time to sleep while waiting for the proxy thread.
private static java.lang.String sExcludeFile
          A file which contains regexes to ignore.
private static java.lang.String sName
          The name of the testcase being recorded.
private static java.lang.String sPathSeparator
          The character used to separate paths on the particular OS.
 
Constructor Summary
httpProxy()
          The default constructor.
httpProxy(int portNumber)
          Constructor which takes 1 argument.
 
Method Summary
static void main(java.lang.String[] argv)
          The main method which is the entry point into the program.
private static void processClientRequest(java.net.Socket client)
          Call the thread which processes the requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acceptor

private static java.net.ServerSocket acceptor
The socket which listens for browser connections.


bRecord

private static boolean bRecord
Indicates whether the browser is currently recording.


bEndProxy

private static boolean bEndProxy
Indicates whether the proxy has finished recording.


sName

private static java.lang.String sName
The name of the testcase being recorded.


sExcludeFile

private static java.lang.String sExcludeFile
A file which contains regexes to ignore.


sPathSeparator

private static java.lang.String sPathSeparator
The character used to separate paths on the particular OS.


hServerTypes

private static java.util.HashMap hServerTypes
A HashMap that contains server type information.


iSleepTime

private static final int iSleepTime
The amount of time to sleep while waiting for the proxy thread.

See Also:
Constant Field Values

iDefaultPort

private static final int iDefaultPort
The default port to use when waiting for connections.

See Also:
Constant Field Values
Constructor Detail

httpProxy

public httpProxy()
          throws java.io.IOException
The default constructor.

Throws:
java.io.IOException - if any IO errors with the socket occur

httpProxy

public httpProxy(int portNumber)
          throws java.io.IOException
Constructor which takes 1 argument.

Parameters:
portNumber - the port on which to listen for connections
Throws:
java.io.IOException - if any socket errors occurred
Method Detail

main

public static void main(java.lang.String[] argv)
The main method which is the entry point into the program.

Parameters:
argv - any command-line arguments

processClientRequest

private static void processClientRequest(java.net.Socket client)
                                  throws java.io.IOException
Call the thread which processes the requests.

Parameters:
client - the client socket, i.e. the connection to the browser
Throws:
java.io.IOException - if any socket errors occur