public interface HttpProxy extends Handler<HttpServerRequest>
Modifier and Type | Method and Description |
---|---|
HttpProxy |
addInterceptor(ProxyInterceptor interceptor)
Add an interceptor to the interceptor chain.
|
void |
handle(HttpServerRequest request)
Handle the outbound
HttpServerRequest . |
default HttpProxy |
origin(int port,
String host)
Set the host name and port number of the origin.
|
HttpProxy |
origin(OriginRequestProvider provider)
Set a provider that creates the request to the origin server based on
ProxyContext . |
default HttpProxy |
origin(SocketAddress address)
Set the
SocketAddress of the origin. |
default HttpProxy |
originRequestProvider(java.util.function.BiFunction<HttpServerRequest,HttpClient,Future<HttpClientRequest>> provider)
Deprecated.
use
origin(OriginRequestProvider) instead |
default HttpProxy |
originSelector(java.util.function.Function<HttpServerRequest,Future<SocketAddress>> selector)
Deprecated.
use
origin(OriginRequestProvider) instead |
static HttpProxy |
reverseProxy(HttpClient client)
Create a new
HttpProxy instance. |
static HttpProxy |
reverseProxy(ProxyOptions options,
HttpClient client)
Create a new
HttpProxy instance. |
static HttpProxy reverseProxy(HttpClient client)
HttpProxy
instance.client
- the HttpClient
that forwards outbound requests to the origin.static HttpProxy reverseProxy(ProxyOptions options, HttpClient client)
HttpProxy
instance.client
- the HttpClient
that forwards outbound requests to the origin.default HttpProxy origin(SocketAddress address)
SocketAddress
of the origin.address
- the SocketAddress
of the origindefault HttpProxy origin(int port, String host)
port
- the port number of the origin serverhost
- the host name of the origin server@Deprecated default HttpProxy originSelector(java.util.function.Function<HttpServerRequest,Future<SocketAddress>> selector)
origin(OriginRequestProvider)
insteadselector
- the selector@Deprecated default HttpProxy originRequestProvider(java.util.function.BiFunction<HttpServerRequest,HttpClient,Future<HttpClientRequest>> provider)
origin(OriginRequestProvider)
insteadprovider
- the providerHttpProxy origin(OriginRequestProvider provider)
ProxyContext
.provider
- the providerHttpProxy addInterceptor(ProxyInterceptor interceptor)
interceptor
- void handle(HttpServerRequest request)
HttpServerRequest
.handle
in interface Handler<HttpServerRequest>
request
- the outbound HttpServerRequest
Copyright © 2025 Eclipse. All rights reserved.