Class HttpTunnelingServlet

  • All Implemented Interfaces:
    java.io.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:
    Serialized Form
    • Field Detail

      • CONNECT_ATTEMPTS

        private static final java.lang.String CONNECT_ATTEMPTS
        See Also:
        Constant Field Values
      • remoteAddress

        private volatile java.net.SocketAddress remoteAddress
      • connectAttempts

        private volatile long connectAttempts
      • retryDelay

        private volatile long retryDelay
    • Constructor Detail

      • HttpTunnelingServlet

        public HttpTunnelingServlet()
    • Method Detail

      • init

        public void init()
                  throws javax.servlet.ServletException
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • parseEndpoint

        protected java.net.SocketAddress parseEndpoint​(java.lang.String endpoint)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createChannelFactory

        protected ChannelFactory createChannelFactory​(java.net.SocketAddress remoteAddress)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class javax.servlet.GenericServlet
      • destroyChannelFactory

        protected void destroyChannelFactory​(ChannelFactory factory)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • service

        protected void service​(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse res)
                        throws javax.servlet.ServletException,
                               java.io.IOException
        Overrides:
        service in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • read

        private static ChannelBuffer read​(java.io.PushbackInputStream in)
                                   throws java.io.IOException
        Throws:
        java.io.IOException