|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.owasp.webscarab.plugin.proxy.Proxy
public class Proxy
The Proxy plugin supports multiple Listeners, and starts and stops them as instructed. All requests and responses are submitted to the model, unless there is an error while retrieving the response.
Constructor Summary | |
---|---|
Proxy(Framework framework)
Creates a Proxy Object with a reference to the Framework. |
Method Summary | |
---|---|
void |
addListener(java.lang.String address,
int port,
HttpUrl base,
java.lang.String simulator,
boolean primary)
used by the User Interface to start a new proxy listening with the specified parameters |
void |
addPlugin(ProxyPlugin plugin)
|
void |
analyse(ConversationID id,
Request request,
Response response,
java.lang.String origin)
|
protected void |
failedResponse(ConversationID id,
java.lang.String reason)
notifies any observers that the request failed to complete, and the reason for it |
void |
flush()
called to instruct the plugin to flush any memory-only state to the store. |
java.lang.String |
getAddress(java.lang.String key)
used to obtain the address that the referenced Listener is bound to |
HttpUrl |
getBase(java.lang.String key)
|
ProxyPlugin |
getPlugin(java.lang.String name)
retrieves the named plugin, if it exists |
java.lang.String |
getPluginName()
The plugin name |
protected ProxyPlugin[] |
getPlugins()
called by ConnectionHandler to see which plugins have been configured. |
int |
getPort(java.lang.String key)
|
java.lang.String[] |
getProxies()
returns a list of keys describing the configured Listeners |
java.lang.Object |
getScriptableObject()
|
Hook[] |
getScriptingHooks()
|
java.lang.String |
getSimulator(java.lang.String key)
|
java.lang.String[] |
getSimulators()
Used to obtain a list of known network simulators, which can be used to simulate a modem or other bandwidth limited connection |
java.lang.String |
getStatus()
called to determine what the current status of the plugin is |
protected ConversationID |
gotRequest(Request request)
used by ConnectionHandler to notify the Proxy (and any listeners) that it is handling a particular request |
protected void |
gotResponse(ConversationID id,
Response response)
used by ConnectionHandler to notify the Proxy (and any listeners) that it has handled a particular request and response, and that it should be logged and analysed |
boolean |
isBusy()
called to test whether the plugin is able to be stopped |
boolean |
isModified()
called to determine whether the data stored within the plugin has been modified and should be saved |
boolean |
isPrimaryProxy(java.lang.String key)
|
boolean |
isRunning()
|
boolean |
removeListener(java.lang.String key)
Used to stop the referenced listener |
void |
run()
Starts the Listeners |
void |
setSession(java.lang.String type,
java.lang.Object store,
java.lang.String session)
informs the plugin that the Session has changed |
void |
setUI(ProxyUI ui)
|
boolean |
stop()
Stops the Listeners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Proxy(Framework framework)
model
- The Model to submit requests and responses toMethod Detail |
---|
public Hook[] getScriptingHooks()
getScriptingHooks
in interface Plugin
public java.lang.Object getScriptableObject()
getScriptableObject
in interface Plugin
public void setUI(ProxyUI ui)
public void addPlugin(ProxyPlugin plugin)
public ProxyPlugin getPlugin(java.lang.String name)
name
- the name of the plugin
public java.lang.String getPluginName()
getPluginName
in interface Plugin
public java.lang.String[] getProxies()
public java.lang.String getAddress(java.lang.String key)
key
- the key referring to a configured Listener
public int getPort(java.lang.String key)
public HttpUrl getBase(java.lang.String key)
public java.lang.String[] getSimulators()
public java.lang.String getSimulator(java.lang.String key)
public boolean isPrimaryProxy(java.lang.String key)
protected ProxyPlugin[] getPlugins()
public void addListener(java.lang.String address, int port, HttpUrl base, java.lang.String simulator, boolean primary) throws java.io.IOException
address
- the address to listen to, null or "" implies localhost, "*" implies all
interfacesport
- the port to listen onbase
- a string such as "http://site:port/" which is used by reverse proxies to
indicate the address that it is acting as.simulator
- a String referring to a network simulatorusePlugins
- indicates whether the ConnectionHandlers spawned by this Listener should pass
Requests and Responses through the defined proxy plugins
java.io.IOException
- if there are any problems starting the Listenerpublic boolean removeListener(java.lang.String key)
key
- the Listener to stop
public void run()
run
in interface java.lang.Runnable
run
in interface Plugin
public boolean stop()
stop
in interface Plugin
protected ConversationID gotRequest(Request request)
request
- the request to log
protected void gotResponse(ConversationID id, Response response)
id
- the Conversation IDresponse
- the Responseprotected void failedResponse(ConversationID id, java.lang.String reason)
reason
- the reason for failureid
- the conversation IDpublic void flush() throws StoreException
Plugin
flush
in interface Plugin
StoreException
- if there is any problem saving the session datapublic boolean isBusy()
Plugin
isBusy
in interface Plugin
public java.lang.String getStatus()
Plugin
getStatus
in interface Plugin
public boolean isModified()
Plugin
isModified
in interface Plugin
public void analyse(ConversationID id, Request request, Response response, java.lang.String origin)
analyse
in interface Plugin
public void setSession(java.lang.String type, java.lang.Object store, java.lang.String session) throws StoreException
Plugin
setSession
in interface Plugin
StoreException
public boolean isRunning()
isRunning
in interface Plugin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |