All Packages Class Hierarchy This Package Previous Next Index
Class COM.webconcepts.net.HttpProxyServiceThread
java.lang.Object
|
+----java.lang.Thread
|
+----COM.webconcepts.net.ServiceThread
|
+----COM.webconcepts.net.HttpProxyServiceThread
- public class HttpProxyServiceThread
- extends ServiceThread
An HttpProxyServiceThread mediates communication between a network client who
wants a copy of a URL and the remote server. It uses the MultiThreadServer framework
for most of the work, and simply defines service() to implement the proxying protocol.
The protocol has only two commands: PROXY url and QUIT. PROXY returns a
Content-length: xxx line with the length of the URL contents followed by the conents
themselves. QUIT terminates the network connection. All commands result in either
a +OK or +ERR return code for the client, as in the POP3 protocol.
- See Also:
- HttpProxyServer, ServiceThread, MultiThreadServer
-
HttpProxyServiceThread()
-
-
service(InputStream, OutputStream)
- service() is called by the run() method of ServiceThread whenever it
accept()s a new client.
HttpProxyServiceThread
public HttpProxyServiceThread()
service
public void service(InputStream in,
OutputStream out) throws Exception
- service() is called by the run() method of ServiceThread whenever it
accept()s a new client. It expects the client to communicate using the simple
proxying protocol outlined above. Error-checking is very limited in this
demonstration version.
- Parameters:
- in - an input stream from the client
- out - an output stream directed to the client
- Overrides:
- service in class ServiceThread
All Packages Class Hierarchy This Package Previous Next Index