io.vertx.httpproxy

## Interface HttpProxy

- All Superinterfaces:
    Handler<HttpServerRequest>

      public interface HttpProxy
      extends Handler<HttpServerRequest>

  Handles the HTTP reverse proxy logic between the user agent and the origin.

  Author:
    Julien Viet

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `handle(HttpServerRequest outboundRequest)` Handle the outbound `HttpServerRequest`.
    `default HttpProxy` | `origin(int port, String host)` Set the host name and port number of the origin.
    `default HttpProxy` | `origin(SocketAddress address)` Set the `SocketAddress` of the origin.
    `HttpProxy` | `originSelector(java.util.function.Function<HttpServerRequest,Future<SocketAddress>> selector)` Set a selector that resolves the origin address based on the outbound request.
    `static HttpProxy` | `reverseProxy(HttpClient client)` Create a new `HttpProxy` instance.
    `static HttpProxy` | `reverseProxy(ProxyOptions options, HttpClient client)` Create a new `HttpProxy` instance.

- - ### Method Detail

    - #### reverseProxy

          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

          static HttpProxy reverseProxy(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

          default HttpProxy origin(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

          default 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

    - #### originSelector

          HttpProxy originSelector(java.util.function.Function<HttpServerRequest,Future<SocketAddress>> selector)

      Set a selector that resolves the origin address based on the outbound request.
      Parameters:
        `selector` - the selector
      Returns:
        a reference to this, so the API can be used fluently

    - #### handle

          void handle(HttpServerRequest outboundRequest)

      Handle the outbound `HttpServerRequest`.
      Specified by:
        `handle` in interface `Handler<HttpServerRequest>`
      Parameters:
        `outboundRequest` - the outbound `HttpServerRequest`

Copyright © 2021 Eclipse. All rights reserved.