public interface ProxyRequest
Modifier and Type | Method and Description |
---|---|
java.lang.String |
absoluteURI() |
ProxyRequest |
bodyFilter(java.util.function.Function<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>,io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>> filter)
Set a body filter.
|
void |
cancel()
Cancel both outbound response by closing its connection
|
Body |
getBody() |
io.vertx.core.http.HttpMethod |
getMethod() |
java.lang.String |
getURI() |
io.vertx.core.MultiMap |
headers() |
io.vertx.core.http.HttpServerRequest |
outboundRequest() |
default io.vertx.core.Future<java.lang.Void> |
proxy(io.vertx.core.http.HttpClientRequest inboundRequest)
Proxy this outbound request and response to the origin server
using the specified inbound request.
|
ProxyRequest |
putHeader(java.lang.CharSequence name,
java.lang.CharSequence value)
Put an HTTP header
|
ProxyRequest |
release()
Release the proxy request.
|
ProxyResponse |
response()
Create and return the proxy response.
|
static ProxyRequest |
reverseProxy(io.vertx.core.http.HttpServerRequest outboundRequest)
Create a new
ProxyRequest instance, the outbound request will be
paused. |
io.vertx.core.Future<ProxyResponse> |
send(io.vertx.core.http.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(io.vertx.core.http.HttpMethod method)
Set the HTTP method to be sent to the origin server.
|
ProxyRequest |
setURI(java.lang.String uri)
Set the request URI to be sent to the origin server.
|
io.vertx.core.http.HttpVersion |
version() |
static ProxyRequest reverseProxy(io.vertx.core.http.HttpServerRequest outboundRequest)
ProxyRequest
instance, the outbound request will be
paused.outboundRequest
- the HttpServerRequest
of the user
agentio.vertx.core.http.HttpVersion version()
java.lang.String absoluteURI()
io.vertx.core.http.HttpMethod getMethod()
ProxyRequest setMethod(io.vertx.core.http.HttpMethod method)
The initial HTTP method value is the outbound request HTTP method.
method
- the new HTTP methodjava.lang.String getURI()
ProxyRequest setURI(java.lang.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 bodyio.vertx.core.MultiMap headers()
ProxyRequest putHeader(java.lang.CharSequence name, java.lang.CharSequence value)
name
- The header namevalue
- The header valueProxyRequest bodyFilter(java.util.function.Function<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>,io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>> filter)
The body filter can rewrite the request body sent to the origin server.
filter
- the filterdefault io.vertx.core.Future<java.lang.Void> proxy(io.vertx.core.http.HttpClientRequest inboundRequest)
inboundRequest
- the request connected to the origin
serverio.vertx.core.Future<ProxyResponse> send(io.vertx.core.http.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.
io.vertx.core.http.HttpServerRequest outboundRequest()
ProxyResponse response()
void cancel()
Copyright © 2023. All Rights Reserved.