|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--prupp.Proxy
This is the central dispatcher for RabbIt, get a connection and create a HTTPHeaderHandler for the connection. Also keeps a lot of variables. Handles logging so it goes out nicely formatted.
Field Summary | |
static java.lang.String |
HELPFILE
which file contains help? |
protected static java.lang.String |
inifile
the standard inifile |
protected static int |
PORT
the standard port |
static java.lang.String |
VERSION
current version |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
Method Summary | |
static boolean |
allowed(java.net.Socket s,
int type)
test if the socket that connects is a ok one |
static boolean |
checkBasicAccess(java.lang.String userid,
java.lang.String pass)
check if a user is authorised |
static java.util.Vector |
getAccesses()
Get the Vector of allowed access |
static NCache |
getCache()
return the cache we have. |
static int |
getConnectPort(int port)
Get the port to connect to. |
static java.lang.String |
getConvert()
get the path to convert |
static java.util.Vector |
getCurrentConections()
returns the current connections. |
static java.util.Vector |
getFilters(java.lang.Object o)
gimme the filters for the object o. |
static HTTPHeader |
getHeader()
Get a standard (200 OK, text/html) header for the proxy, useful for metapages etc... |
static HTTPHeader |
getHeader(java.lang.String statusLine)
Get a header for the proxy. |
static java.net.InetAddress |
getHost()
Get the local host. |
static java.net.InetAddress |
getInetAddress(java.net.URL urltoget)
get the inetAdress of an URL |
static int |
getNoOfServedPages()
return the number of pages that are fully served |
static int |
getPort()
Get the port this proxy is using. |
static java.util.Properties |
getProperties()
return the configuration of the proxy. |
static java.lang.String |
getSmallLogo()
Get the small logo string. |
static java.util.Date |
getStartDate()
return the time when the proxy was started. |
static java.util.Hashtable |
getUsers()
Get the Hashtable of users->password entries. |
static boolean |
isMetaRestricted()
simple test for now (until all pages are checked). |
static boolean |
isProxyConnected()
are we connected to another proxy? |
protected static void |
kill()
shutdown |
static void |
logError(java.lang.String error)
log errors and other important stuff. |
static void |
logRequest(java.net.Socket socket,
Responder responder)
log accesses. |
static void |
main(java.lang.String[] args)
Start a proxy. |
static void |
printHelp()
print out the helptext to the user. |
protected static void |
readAccess()
reads in the accessfile and parses out the given ranges and types given. |
static void |
readAccess(java.io.Reader r)
reads in the accessess allowed from the given Reader |
protected static void |
readFilterConfig()
set up the filters to use. |
protected static void |
readIniFile(java.lang.String filename)
load the config for the Proxy. |
static void |
readUsers()
read in the users specified in basicusersfile |
static void |
readUsers(java.io.Reader r)
reads the users from a given Reader |
static void |
removeConnection(HTTPHeaderHandler con)
Remove a connection (it has received full treatment) |
void |
run()
while we can, accept new sockets, creating a handler for each and also save connections for statistics. |
static void |
saveAccess()
save access configuration back to file |
static void |
saveConfig()
save the config back to file |
static void |
saveFilterConfig()
save filter configuration back to file |
static void |
saveUsers()
save (auth)user configuration back to file |
static void |
setConvert(java.lang.String conv)
set the path to convert, the program we use to convert images |
static void |
setSmallLogo(java.lang.String s)
Set the small logo used on meta-pages etc |
protected static void |
setup(java.util.Properties config)
handle the setup of this Proxy. |
Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
setContextClassLoader,
setDaemon,
setName,
setPriority,
sleep,
sleep,
start,
stop,
stop,
suspend,
toString,
yield |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String VERSION
public static final java.lang.String HELPFILE
protected static final int PORT
protected static java.lang.String inifile
Method Detail |
public static void main(java.lang.String[] args)
args
- the command-line flags given.public void run()
public static boolean allowed(java.net.Socket s, int type)
socket
- the Socket that connectspublic static void removeConnection(HTTPHeaderHandler con)
con
- the connection that is closing down.public static void logRequest(java.net.Socket socket, Responder responder)
socket
- the Socket were talking to.responder
- the responsehandler that handled the request.public static void logError(java.lang.String error)
error
- the thing that happend.public static java.util.Vector getFilters(java.lang.Object o)
o
- the object were filtering.public static java.net.InetAddress getInetAddress(java.net.URL urltoget) throws java.net.UnknownHostException
urltoget
- the URL were intrested in.public static int getConnectPort(int port)
port
- the port we want to connect to.public static boolean isProxyConnected()
public static void printHelp()
protected static void readIniFile(java.lang.String filename)
public static void setConvert(java.lang.String conv)
conv
- the new path to convertpublic static java.lang.String getConvert()
public static java.lang.String getSmallLogo()
public static void setSmallLogo(java.lang.String s)
s
- the new string to the logoprotected static void setup(java.util.Properties config)
config
- the Property to use.public static void saveConfig()
public static void saveFilterConfig()
public static void saveAccess()
public static void saveUsers()
public static int getPort()
public static java.net.InetAddress getHost()
public static java.util.Properties getProperties()
public static boolean isMetaRestricted()
public static java.util.Vector getCurrentConections()
public static java.util.Date getStartDate()
public static int getNoOfServedPages()
public static NCache getCache()
protected static void readFilterConfig()
public static java.util.Vector getAccesses()
protected static void readAccess()
public static void readAccess(java.io.Reader r) throws java.io.IOException
r
- the Reader were data is availablepublic static java.util.Hashtable getUsers()
public static void readUsers()
public static void readUsers(java.io.Reader r) throws java.io.IOException
r
- the Reader to read users from.public static boolean checkBasicAccess(java.lang.String userid, java.lang.String pass)
userid
- the userid we check.pass
- the password supplied.public static HTTPHeader getHeader()
public static HTTPHeader getHeader(java.lang.String statusLine)
statusLine
- the Statusline of this header.protected static void kill()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |