Class HttpProxy

  • All Implemented Interfaces:
    ServiceConsumer

    public class HttpProxy
    extends HttpServer
    Http proxy implementation
    Author:
    javaito
    • Constructor Detail

      • HttpProxy

        public HttpProxy​(java.lang.Integer port)
      • HttpProxy

        public HttpProxy()
    • Method Detail

      • addRule

        public final void addRule​(HttpProxyRule rule)
        Adds a rule to redirect incoming requests.
        Parameters:
        rule - Http proxy rule.
        Throws:
        java.lang.NullPointerException - if the rule parameter is null.
      • addContext

        public final void addContext​(Context context)
        This kind of http server not support custom context because there are only one context to take the incoming request and redirect the traffic using the storage rules.
        Overrides:
        addContext in class HttpServer
        Parameters:
        context - Http context.
        Throws:
        java.lang.UnsupportedOperationException - all calls
      • findContext

        protected final HttpServer.ContextMatcher findContext​(java.lang.String contextName)
        All the times return the same internal context.
        Overrides:
        findContext in class HttpServer
        Parameters:
        contextName - This parameter is ignored.
        Returns:
        Always returns the unique internal context