Class HttpTunnelingServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.jboss.netty.channel.socket.http.HttpTunnelingServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class HttpTunnelingServlet
extends javax.servlet.http.HttpServlet
An
HttpServlet that proxies an incoming data to the actual server
and vice versa. Please refer to the
package summary for
the detailed usage.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelFactoryprivate static final Stringprivate longprivate static final String(package private) static final InternalLoggerprivate SocketAddressprivate static final Stringprivate longprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ChannelFactorycreateChannelFactory(SocketAddress remoteAddress) voiddestroy()protected voiddestroyChannelFactory(ChannelFactory factory) voidinit()protected SocketAddressparseEndpoint(String endpoint) private static ChannelBufferprotected voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
ENDPOINT
- See Also:
-
CONNECT_ATTEMPTS
- See Also:
-
RETRY_DELAY
- See Also:
-
logger
-
remoteAddress
-
channelFactory
-
connectAttempts
private volatile long connectAttempts -
retryDelay
private volatile long retryDelay
-
-
Constructor Details
-
HttpTunnelingServlet
public HttpTunnelingServlet()
-
-
Method Details
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
parseEndpoint
- Throws:
Exception
-
createChannelFactory
- Throws:
Exception
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
destroyChannelFactory
- Throws:
Exception
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException - Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
read
- Throws:
IOException
-