Class ProxyRequest

java.lang.Object
io.vertx.rxjava3.httpproxy.ProxyRequest
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate

public class ProxyRequest extends Object implements io.vertx.lang.rx.RxDelegate
Handles the interoperability of the request between the user agent and the origin.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final io.vertx.lang.rx.TypeArg<ProxyRequest> __TYPE_ARG
  • Constructor Details

    • ProxyRequest

      public ProxyRequest(ProxyRequest delegate)
    • ProxyRequest

      public ProxyRequest(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

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

      public ProxyRequest getDelegate()
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
    • reverseProxy

      public static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest)
      Create a new ProxyRequest instance, the proxied request will be paused.
      Parameters:
      proxiedRequest - the HttpServerRequest that is proxied
      Returns:
      a reference to this, so the API can be used fluently
    • reverseProxy

      public static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest, ForwardedHeadersOptions forwardedHeadersOptions)
      Like reverseProxy(HttpServerRequest) but using specific For
      Parameters:
      proxiedRequest -
      forwardedHeadersOptions -
      Returns:
    • version

      public HttpVersion version()
      Returns:
      the HTTP version of the proxied request
    • absoluteURI

      public String absoluteURI()
      Returns:
      the absolute URI of the proxied request
    • getMethod

      public HttpMethod getMethod()
      Returns:
      the HTTP method to be sent to the origin server.
    • setMethod

      public ProxyRequest setMethod(HttpMethod method)
      Set the HTTP method to be sent to the origin server.

      The initial HTTP method value is the proxied request HTTP method.

      Parameters:
      method - the new HTTP method
      Returns:
      a reference to this, so the API can be used fluently
    • getURI

      public String getURI()
      Returns:
      the request URI to be sent to the origin server.
    • setURI

      public ProxyRequest setURI(String uri)
      Set the request URI to be sent to the origin server.

      The initial request URI value is the proxied request URI.

      Parameters:
      uri - the new URI
      Returns:
      a reference to this, so the API can be used fluently
    • getBody

      public Body getBody()
      Returns:
      the request body to be sent to the origin server.
    • setBody

      public ProxyRequest setBody(Body body)
      Set the request body to be sent to the origin server.

      The initial request body value is the proxied request body.

      Parameters:
      body - the new body
      Returns:
      a reference to this, so the API can be used fluently
    • setAuthority

      public ProxyRequest setAuthority(HostAndPort authority)
      Set the request authority.
      • for HTTP/1 the header
      • for HTTP/2 the pseudo header
      The value must follow the syntax.
      Parameters:
      authority - the authority
      Returns:
      a reference to this, so the API can be used fluently
    • getAuthority

      public HostAndPort getAuthority()
      Returns:
      the request authority, for HTTP2 the pseudo header otherwise the header
    • headers

      public MultiMap headers()
      Returns:
      the headers that will be sent to the origin server, the returned headers can be modified. The headers map is populated with the proxied request headers
    • proxy

      public Completable proxy(HttpClientRequest request)
      Proxy this request to the origin server using the specified request and then send the proxy response.
      Parameters:
      request - the request connected to the origin server
      Returns:
    • rxProxy

      public Completable rxProxy(HttpClientRequest request)
      Proxy this request to the origin server using the specified request and then send the proxy response.
      Parameters:
      request - the request connected to the origin server
      Returns:
    • send

      public Single<ProxyResponse> send(HttpClientRequest request)
      Send this request to the origin server using the specified request.

      The returned future will be completed with the proxy response returned by the origin.

      Parameters:
      request - the request connected to the origin server
      Returns:
    • rxSend

      public Single<ProxyResponse> rxSend(HttpClientRequest request)
      Send this request to the origin server using the specified request.

      The returned future will be completed with the proxy response returned by the origin.

      Parameters:
      request - the request connected to the origin server
      Returns:
    • release

      public ProxyRequest release()
      Release the proxy request and its associated resources.

      The HTTP server request is resumed, no HTTP server response is sent.

      Returns:
      a reference to this, so the API can be used fluently
    • proxiedRequest

      public HttpServerRequest proxiedRequest()
      Returns:
      the proxied HTTP server request
    • response

      public ProxyResponse response()
      Create and return the proxy response.
      Returns:
      the proxy response
    • newInstance

      public static ProxyRequest newInstance(ProxyRequest arg)