Package io.vertx.rxjava3.httpproxy
Class HttpProxy
- java.lang.Object
-
- io.vertx.rxjava3.httpproxy.HttpProxy
-
- All Implemented Interfaces:
Handler<HttpServerRequest>
public class HttpProxy extends Object implements Handler<HttpServerRequest>
Handles the HTTP reverse proxy logic 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 Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<HttpProxy>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpProxy
addInterceptor(ProxyInterceptor interceptor)
Add an interceptor to the interceptor chain.HttpProxy
addInterceptor(ProxyInterceptor interceptor, boolean supportsWebSocketUpgrade)
Add an interceptor to the interceptor chain.boolean
equals(Object o)
HttpProxy
getDelegate()
void
handle(HttpServerRequest request)
Handle the outboundHttpServerRequest
.int
hashCode()
static HttpProxy
newInstance(HttpProxy arg)
HttpProxy
origin(int port, String host)
Set the host name and port number of the origin.HttpProxy
origin(SocketAddress address)
Set theSocketAddress
of the origin.HttpProxy
originSelector(java.util.function.Function<HttpServerRequest,Single<SocketAddress>> selector)
Set a selector that resolves the origin address based on the incoming HTTP request.static HttpProxy
reverseProxy(ProxyOptions options, HttpClient client)
Create a newHttpProxy
instance.static HttpProxy
reverseProxy(HttpClient client)
Create a newHttpProxy
instance.String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<HttpProxy> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public HttpProxy getDelegate()
-
reverseProxy
public static HttpProxy reverseProxy(HttpClient client)
Create a newHttpProxy
instance.- Parameters:
client
- theHttpClient
that forwards outbound requests to the origin.- Returns:
- a reference to this, so the API can be used fluently.
-
reverseProxy
public static HttpProxy reverseProxy(ProxyOptions options, HttpClient client)
Create a newHttpProxy
instance.- Parameters:
options
-client
- theHttpClient
that forwards outbound requests to the origin.- Returns:
- a reference to this, so the API can be used fluently.
-
origin
public HttpProxy origin(SocketAddress address)
Set theSocketAddress
of the origin.- Parameters:
address
- theSocketAddress
of the origin- Returns:
- a reference to this, so the API can be used fluently
-
origin
public HttpProxy origin(int port, String host)
Set the host name and port number of the origin.- Parameters:
port
- the port number of the origin serverhost
- the host name of the origin server- Returns:
- a reference to this, so the API can be used fluently
-
originSelector
public HttpProxy originSelector(java.util.function.Function<HttpServerRequest,Single<SocketAddress>> selector)
Set a selector that resolves the origin address based on the incoming HTTP request.- Parameters:
selector
- the selector- Returns:
- a reference to this, so the API can be used fluently
-
addInterceptor
public HttpProxy addInterceptor(ProxyInterceptor interceptor)
Add an interceptor to the interceptor chain.Interceptors are invoked in order of configuration. When added with this method, it is considered the interceptor doesn't support WebSocket upgrades.
- Parameters:
interceptor
- theProxyInterceptor
to add- Returns:
- a reference to this, so the API can be used fluently
-
addInterceptor
public HttpProxy addInterceptor(ProxyInterceptor interceptor, boolean supportsWebSocketUpgrade)
Add an interceptor to the interceptor chain.Interceptors are invoked in order of configuration.
- Parameters:
interceptor
- theProxyInterceptor
to addsupportsWebSocketUpgrade
- whether the interceptor supports WebSocket upgrades- Returns:
- a reference to this, so the API can be used fluently
-
handle
public void handle(HttpServerRequest request)
Handle the outboundHttpServerRequest
.- Specified by:
handle
in interfaceHandler<HttpServerRequest>
- Parameters:
request
- the outboundHttpServerRequest
-
-