Package io.vertx.rxjava3.httpproxy
Class ProxyRequest
- java.lang.Object
-
- io.vertx.rxjava3.httpproxy.ProxyRequest
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<ProxyRequest>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description ProxyRequest(ProxyRequest delegate)
ProxyRequest(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
absoluteURI()
boolean
equals(Object o)
HostAndPort
getAuthority()
Body
getBody()
ProxyRequest
getDelegate()
HttpMethod
getMethod()
String
getURI()
int
hashCode()
MultiMap
headers()
static ProxyRequest
newInstance(ProxyRequest arg)
HttpServerRequest
proxiedRequest()
Completable
proxy(HttpClientRequest request)
Proxy this request to the origin server using the specifiedrequest
and then send the proxy response.ProxyRequest
release()
Release the proxy request and its associated resourcesProxyResponse
response()
Create and return the proxy response.static ProxyRequest
reverseProxy(HttpServerRequest proxiedRequest)
Create a newProxyRequest
instance, the proxied request will be paused.Completable
rxProxy(HttpClientRequest request)
Proxy this request to the origin server using the specifiedrequest
and then send the proxy response.Single<ProxyResponse>
rxSend(HttpClientRequest request)
Send this request to the origin server using the specifiedrequest
.Single<ProxyResponse>
send(HttpClientRequest request)
Send this request to the origin server using the specifiedrequest
.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.ProxyRequest
setBody(Body body)
Set the request body to be sent to the origin server.ProxyRequest
setMethod(HttpMethod method)
Set the HTTP method to be sent to the origin server.ProxyRequest
setURI(String uri)
Set the request URI to be sent to the origin server.String
toString()
HttpVersion
version()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<ProxyRequest> __TYPE_ARG
-
-
Constructor Detail
-
ProxyRequest
public ProxyRequest(ProxyRequest delegate)
-
ProxyRequest
public ProxyRequest(Object delegate)
-
-
Method Detail
-
getDelegate
public ProxyRequest getDelegate()
-
reverseProxy
public static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest)
Create a newProxyRequest
instance, the proxied request will be paused.- Parameters:
proxiedRequest
- theHttpServerRequest
that is proxied- Returns:
- a reference to this, so the API can be used fluently
-
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
- 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 specifiedrequest
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 specifiedrequest
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 specifiedrequest
.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 specifiedrequest
.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 resourcesThe 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)
-
-