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 theoriginalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<HttpProxy>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpProxyaddInterceptor(ProxyInterceptor interceptor)Add an interceptor to the interceptor chain.booleanequals(Object o)HttpProxygetDelegate()voidhandle(HttpServerRequest request)Handle the outboundHttpServerRequest.inthashCode()static HttpProxynewInstance(HttpProxy arg)HttpProxyorigin(int port, String host)Set the host name and port number of the origin.HttpProxyorigin(SocketAddress address)Set theSocketAddressof the origin.HttpProxyoriginSelector(Function<HttpServerRequest,io.reactivex.rxjava3.core.Single<SocketAddress>> selector)Set a selector that resolves the origin address based on the incoming HTTP request.static HttpProxyreverseProxy(ProxyOptions options, HttpClient client)Create a newHttpProxyinstance.static HttpProxyreverseProxy(HttpClient client)Create a newHttpProxyinstance.StringtoString()
-
-
-
Method Detail
-
getDelegate
public HttpProxy getDelegate()
-
reverseProxy
public static HttpProxy reverseProxy(HttpClient client)
Create a newHttpProxyinstance.- Parameters:
client- theHttpClientthat 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 newHttpProxyinstance.- Parameters:
options-client- theHttpClientthat 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 theSocketAddressof the origin.- Parameters:
address- theSocketAddressof 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(Function<HttpServerRequest,io.reactivex.rxjava3.core.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.- Parameters:
interceptor-- Returns:
- a reference to this, so the API can be used fluently
-
handle
public void handle(HttpServerRequest request)
Handle the outboundHttpServerRequest.- Specified by:
handlein interfaceHandler<HttpServerRequest>- Parameters:
request- the outboundHttpServerRequest
-
-