public final class HttpProxy extends java.lang.Object implements RunnableWhichThrows<java.io.IOException>, Stoppable
| Constructor and Description |
|---|
HttpProxy(java.net.InetSocketAddress endpoint,
java.net.InetSocketAddress remoteAddress) |
HttpProxy(java.net.InetSocketAddress endpoint,
java.net.InetSocketAddress remoteAddress,
TransformerWhichThrows<? super HttpRequest,HttpRequest,java.io.IOException> requestTransformer,
TransformerWhichThrows<? super HttpResponse,HttpResponse,java.io.IOException> responseTransformer) |
HttpProxy(java.net.InetSocketAddress endpoint,
java.lang.String remoteHost,
int remotePort) |
HttpProxy(java.net.InetSocketAddress endpoint,
java.lang.String remoteHost,
int remotePort,
TransformerWhichThrows<? super HttpRequest,HttpRequest,java.io.IOException> requestTransformer,
TransformerWhichThrows<? super HttpResponse,HttpResponse,java.io.IOException> responseTransformer) |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetSocketAddress |
getEndpointAddress() |
void |
run()
"To run" an instance means to call this method and wait until it returns.
|
void |
stop()
Returns when this
Stoppable has completely stopped. |
public HttpProxy(java.net.InetSocketAddress endpoint,
java.net.InetSocketAddress remoteAddress)
throws java.io.IOException
endpoint - The local endpoint (interface) to bind toremoteAddress - The address of the remote server to connect tojava.io.IOExceptionpublic HttpProxy(java.net.InetSocketAddress endpoint,
java.lang.String remoteHost,
int remotePort)
throws java.io.IOException
endpoint - The local endpoint (interface) to bind toremoteHost - The name of the remote server to connect toremotePort - The port on the remote serverjava.io.IOExceptionpublic HttpProxy(java.net.InetSocketAddress endpoint,
java.net.InetSocketAddress remoteAddress,
TransformerWhichThrows<? super HttpRequest,HttpRequest,java.io.IOException> requestTransformer,
TransformerWhichThrows<? super HttpResponse,HttpResponse,java.io.IOException> responseTransformer)
throws java.io.IOException
endpoint - The local endpoint (interface) to bind toremoteAddress - The address of the remote server to connect torequestTransformer - Could modify requests as they are forwarded from the client to the serverresponseTransformer - Could modify responses as they are forwarded from the server to the clientjava.io.IOExceptionpublic HttpProxy(java.net.InetSocketAddress endpoint,
java.lang.String remoteHost,
int remotePort,
TransformerWhichThrows<? super HttpRequest,HttpRequest,java.io.IOException> requestTransformer,
TransformerWhichThrows<? super HttpResponse,HttpResponse,java.io.IOException> responseTransformer)
throws java.io.IOException
endpoint - The local endpoint (interface) to bind toremoteHost - The name of the remote server to connect toremotePort - The port on the remote serverrequestTransformer - Could modify requests as they are forwarded from the client to the serverresponseTransformer - Could modify responses as they are forwarded from the server to the clientjava.io.IOExceptionpublic void run()
throws java.io.IOException
RunnableWhichThrowsrun in interface RunnableWhichThrows<java.io.IOException>java.io.IOExceptionpublic void stop()
StoppableStoppable has completely stopped.public java.net.InetSocketAddress getEndpointAddress()