Package io.servicetalk.http.api
Interface ProxyConfig<A>
- Type Parameters:
A- the type of address
public interface ProxyConfig<A>
Configuration for a proxy.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddress()Address of the proxy.An initializer forHttpHeadersrelated to HTTP/1.1 CONNECT request.static <A> ProxyConfig<A>forAddress(A address) Returns aProxyConfigfor the specifiedaddress.
-
Method Details
-
address
A address()Address of the proxy.Usually, this is an unresolved proxy address and its type must match the type of address before resolution used by
SingleAddressHttpClientBuilder. However, if the client builder was created for a resolved address, this address must also be already resolved. Otherwise, a runtime exception will occur.- Returns:
- address of the proxy
-
connectRequestHeadersInitializer
Consumer<HttpHeaders> connectRequestHeadersInitializer()An initializer forHttpHeadersrelated to HTTP/1.1 CONNECT request.When this
ProxyConfigis used for secure proxy tunnels (whenClientSslConfigis configured) the tunnel is always initialized usingHTTP/1.1 CONNECTrequest. ThisConsumercan be used to set customHttpHeadersfor that request, likeproxy-authorization, tracing, or any other header.- Returns:
- An initializer for
HttpHeadersrelated to HTTP/1.1 CONNECT request
-
forAddress
Returns aProxyConfigfor the specifiedaddress.All other
ProxyConfigoptions will use their default values applied byProxyConfigBuilder.- Type Parameters:
A- the type of address- Parameters:
address- Address of the proxy- Returns:
- a
ProxyConfigfor the specifiedaddress - See Also:
-