|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrabbit.proxy.HttpProxy
public class HttpProxy
A filtering and caching http proxy.
Field Summary | |
---|---|
protected boolean |
proxySSL
Are we allowed to proxy ssl? |
protected List<Integer> |
sslports
The List of acceptable ssl-ports. |
static String |
VERSION
Current version |
Constructor Summary | |
---|---|
HttpProxy()
Create a new HttpProxy. |
Method Summary | ||
---|---|---|
void |
addCurrentConnection(Connection con)
Add a current connection |
|
BufferHandler |
getBufferHandler()
Get the BufferHandler this proxy is using |
|
Cache<HttpHeader,HttpHeader> |
getCache()
Get the cache that this proxy is currently using. |
|
rabbit.proxy.ClientTrafficLoggerHandler |
getClientTrafficLoggerHandler()
Get the ClientTrafficLoggerHandler |
|
Config |
getConfig()
Get the configuration of the proxy. |
|
ConnectionHandler |
getConnectionHandler()
Get the connection handler. |
|
Counter |
getCounter()
Get the current Counter |
|
List<Connection> |
getCurrentConnections()
Get all the current connections |
|
InetAddress |
getHost()
Get the local host. |
|
HttpGeneratorFactory |
getHttpGeneratorFactory()
Get the current HttpGeneratorFactory. |
|
NioHandler |
getNioHandler()
Get the NioHandler that this proxy is using. |
|
long |
getOffset()
Get the time offset, that is the time between GMT and local time. |
|
int |
getPort()
Get the port this proxy is using. |
|
ProxyChain |
getProxyChain()
Get the ProxyChain this proxy is currently using |
|
String |
getServerIdentity()
Get the current server identity. |
|
long |
getStartTime()
Get the time this proxy was started. |
|
boolean |
getStrictHttp()
Check if strict http is turned on or off. |
|
TrafficLoggerHandler |
getTrafficLoggerHandler()
Get the currently transferred traffic statistics. |
|
String |
getVersion()
Get the version of this proxy. |
|
void |
getWebConnection(HttpHeader header,
WebConnectionListener wcl)
Get a WebConnection. |
|
boolean |
isSelf(String uhost,
int urlport)
Try hard to check if the given address matches the proxy. |
|
|
load3rdPartyClass(String name,
Class<T> type)
Load a 3:rd party class. |
|
void |
markForPipelining(WebConnection wc)
Mark a WebConnection for pipelining. |
|
void |
releaseWebConnection(WebConnection wc)
Release a WebConnection so that it may be reused if possible. |
|
void |
removeCurrentConnection(Connection con)
Remove a current connection. |
|
void |
setConfig(String conf)
Set the config file to use for this proxy. |
|
void |
setStrictHttp(boolean b)
Toogle the strict http flag. |
|
void |
start()
Run the proxy in a separate thread. |
|
void |
stop()
Run the proxy in a separate thread. |
|
protected void |
updateTrafficLog(TrafficLoggerHandler tlh)
Update the currently transferred traffic statistics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION
protected boolean proxySSL
protected List<Integer> sslports
Constructor Detail |
---|
public HttpProxy() throws UnknownHostException
UnknownHostException
- if the local host address can not
be determinedMethod Detail |
---|
public void setConfig(String conf) throws IOException
conf
- the name of the file to use for proxy configuration.
IOException
- if the config file can not be readpublic void setStrictHttp(boolean b)
b
- the new mode for the strict http flagpublic boolean getStrictHttp()
public void start()
public void stop()
public NioHandler getNioHandler()
public Cache<HttpHeader,HttpHeader> getCache()
public long getOffset()
public long getStartTime()
public Counter getCounter()
public Config getConfig()
public String getVersion()
public String getServerIdentity()
public InetAddress getHost()
public int getPort()
public ProxyChain getProxyChain()
public boolean isSelf(String uhost, int urlport)
uhost
- the host name to checkurlport
- the port number to check
public void getWebConnection(HttpHeader header, WebConnectionListener wcl)
header
- the http header to get the host and port fromwcl
- the listener that wants to get the connection.public void releaseWebConnection(WebConnection wc)
wc
- the WebConnection to release.public void markForPipelining(WebConnection wc)
wc
- the WebConnection to mark.public void addCurrentConnection(Connection con)
con
- the connectionpublic void removeCurrentConnection(Connection con)
con
- the connectionpublic ConnectionHandler getConnectionHandler()
public List<Connection> getCurrentConnections()
protected void updateTrafficLog(TrafficLoggerHandler tlh)
tlh
- the traffic statistics for some operationpublic TrafficLoggerHandler getTrafficLoggerHandler()
public rabbit.proxy.ClientTrafficLoggerHandler getClientTrafficLoggerHandler()
public BufferHandler getBufferHandler()
public HttpGeneratorFactory getHttpGeneratorFactory()
public <T> Class<? extends T> load3rdPartyClass(String name, Class<T> type) throws ClassNotFoundException
T
- the type of the clasname
- the fully qualified name of the class to loadtype
- the super type of the class
ClassNotFoundException
- if the class can not be found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |