Class HttpProxy

java.lang.Object
io.vertx.mutiny.httpproxy.HttpProxy
All Implemented Interfaces:
MutinyDelegate, io.vertx.core.Handler<HttpServerRequest>, Consumer<HttpServerRequest>

public class HttpProxy extends Object implements io.vertx.core.Handler<HttpServerRequest>, Consumer<HttpServerRequest>, MutinyDelegate
Handles the HTTP reverse proxy logic between the user agent and the origin.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Julien Viet
See Also:
  • HttpProxy
  • Field Details

  • Constructor Details

    • HttpProxy

      public HttpProxy(io.vertx.httpproxy.HttpProxy delegate)
      Create a new instance of HttpProxy delegating to the given (non-null) instance of HttpProxy.
    • HttpProxy

      public HttpProxy(Object delegate)
  • Method Details

    • accept

      public void accept(HttpServerRequest item)
      Handle an item. This method is generated from the original method."
      Specified by:
      accept in interface Consumer<HttpServerRequest>
    • getDelegate

      public io.vertx.httpproxy.HttpProxy getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • reverseProxy

      public static HttpProxy reverseProxy(HttpClient client)
      Create a new HttpProxy instance.
      Parameters:
      client - the HttpClient that forwards outbound requests to the origin.
      Returns:
      a reference to this, so the API can be used fluently.
    • reverseProxy

      public static HttpProxy reverseProxy(io.vertx.httpproxy.ProxyOptions options, HttpClient client)
      Create a new HttpProxy instance.
      Parameters:
      client - the HttpClient that forwards outbound requests to the origin.
      Returns:
      a reference to this, so the API can be used fluently.
    • origin

      public HttpProxy origin(io.vertx.core.net.SocketAddress address)
      Set the SocketAddress of the origin.
      Parameters:
      address - the SocketAddress of the origin
      Returns:
      a reference to this, so the API can be used fluently
    • origin

      public HttpProxy origin(int port, String host)
      Set the host name and port number of the origin.
      Parameters:
      port - the port number of the origin server
      host - the host name of the origin server
      Returns:
      a reference to this, so the API can be used fluently
    • origin

      public HttpProxy origin(OriginRequestProvider provider)
      Set a provider that creates the request to the origin server based on ProxyContext.
      Parameters:
      provider - the provider
      Returns:
      a reference to this, so the API can be used fluently
    • addInterceptor

      public HttpProxy addInterceptor(ProxyInterceptor interceptor)
      Add an interceptor to the interceptor chain.

      Interceptors are invoked in order of configuration. When added with this method, it is considered the interceptor doesn't support WebSocket upgrades.

      Parameters:
      interceptor - the ProxyInterceptor to add
      Returns:
      a reference to this, so the API can be used fluently
    • addInterceptor

      public HttpProxy addInterceptor(ProxyInterceptor interceptor, boolean supportsWebSocketUpgrade)
      Add an interceptor to the interceptor chain.

      Interceptors are invoked in order of configuration.

      Parameters:
      interceptor - the ProxyInterceptor to add
      supportsWebSocketUpgrade - whether the interceptor supports WebSocket upgrades
      Returns:
      a reference to this, so the API can be used fluently
    • handle

      public void handle(HttpServerRequest request)
      Handle the outbound HttpServerRequest.
      Specified by:
      handle in interface io.vertx.core.Handler<HttpServerRequest>
      Parameters:
      request - the outbound HttpServerRequest
    • newInstance

      public static HttpProxy newInstance(io.vertx.httpproxy.HttpProxy delegate)
      Creates a new instance of the HttpProxy.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object