public interface ProxyRequest
Modifier and Type | Method and Description |
---|---|
String |
absoluteURI() |
ProxyRequest |
bodyFilter(java.util.function.Function<ReadStream<Buffer>,ReadStream<Buffer>> filter)
Set a body filter.
|
Body |
getBody() |
HttpMethod |
getMethod() |
String |
getURI() |
MultiMap |
headers() |
HttpServerRequest |
outboundRequest() |
default Future<Void> |
proxy(HttpClientRequest inboundRequest)
Proxy this outbound request and response to the origin server using the specified inbound request.
|
ProxyRequest |
putHeader(CharSequence name,
CharSequence value)
Put an HTTP header
|
ProxyRequest |
release()
Release the proxy request.
|
ProxyResponse |
response()
Create and return the proxy response.
|
static ProxyRequest |
reverseProxy(HttpServerRequest outboundRequest)
Create a new
ProxyRequest instance, the outbound request will be paused. |
Future<ProxyResponse> |
send(HttpClientRequest inboundRequest)
Send this request to the origin server using the specified inbound request.
|
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.
|
HttpVersion |
version() |
static ProxyRequest reverseProxy(HttpServerRequest outboundRequest)
ProxyRequest
instance, the outbound request will be paused.outboundRequest
- the HttpServerRequest
of the user agentHttpVersion version()
String absoluteURI()
HttpMethod getMethod()
ProxyRequest setMethod(HttpMethod method)
The initial HTTP method value is the outbound request HTTP method.
method
- the new HTTP methodString getURI()
ProxyRequest setURI(String uri)
The initial request URI value is the outbound request URI.
uri
- the new URIBody getBody()
ProxyRequest setBody(Body body)
The initial request body value is the outbound request body.
body
- the new bodyMultiMap headers()
ProxyRequest putHeader(CharSequence name, CharSequence value)
name
- The header namevalue
- The header valueProxyRequest bodyFilter(java.util.function.Function<ReadStream<Buffer>,ReadStream<Buffer>> filter)
The body filter can rewrite the request body sent to the origin server.
filter
- the filterdefault Future<Void> proxy(HttpClientRequest inboundRequest)
inboundRequest
- the request connected to the origin serverFuture<ProxyResponse> send(HttpClientRequest inboundRequest)
The completionHandler
will be called with the proxy response sent by the origin.
inboundRequest
- the request connected to the origin serverProxyRequest release()
The HTTP server request is resumed, no HTTP server response is sent.
HttpServerRequest outboundRequest()
ProxyResponse response()
Copyright © 2021 Eclipse. All rights reserved.