Class ClientTransport
- java.lang.Object
-
- akka.http.javadsl.ClientTransport
-
public abstract class ClientTransport extends java.lang.Object
SPI for implementors of custom client transports.
-
-
Constructor Summary
Constructors Constructor Description ClientTransport()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract akka.stream.javadsl.Flow<akka.util.ByteString,akka.util.ByteString,java.util.concurrent.CompletionStage<OutgoingConnection>>
connectTo(java.lang.String host, int port, ClientConnectionSettings settings, akka.actor.ActorSystem system)
static ClientTransport
fromScala(ClientTransport scalaTransport)
static ClientTransport
httpsProxy(akka.actor.ActorSystem system)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method.static ClientTransport
httpsProxy(HttpCredentials proxyCredentials, akka.actor.ActorSystem system)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method.static ClientTransport
httpsProxy(java.net.InetSocketAddress proxyAddress)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method.static ClientTransport
httpsProxy(java.net.InetSocketAddress proxyAddress, HttpCredentials proxyCredentials)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method.static ClientTransport
TCP()
static ClientTransport
toScala(ClientTransport javaTransport)
static ClientTransport
withCustomResolver(java.util.function.BiFunction<java.lang.String,java.lang.Object,java.util.concurrent.CompletionStage<java.net.InetSocketAddress>> lookup)
Returns aClientTransport
that allows to customize host name resolution.
-
-
-
Method Detail
-
TCP
public static ClientTransport TCP()
-
httpsProxy
public static ClientTransport httpsProxy(java.net.InetSocketAddress proxyAddress)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method.An HTTP(S) proxy is a proxy that will create one TCP connection to the HTTP(S) proxy for each target connection. The proxy transparently forwards the TCP connection to the target host.
For more information about HTTP CONNECT tunnelling see https://tools.ietf.org/html/rfc7231#section-4.3.6.
- Parameters:
proxyAddress
- (undocumented)- Returns:
- (undocumented)
-
httpsProxy
public static ClientTransport httpsProxy(akka.actor.ActorSystem system)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method.Pulls the host/port pair from the application.conf: akka.client.proxy.https.{host, port}
- Parameters:
system
- (undocumented)- Returns:
- (undocumented)
-
httpsProxy
public static ClientTransport httpsProxy(java.net.InetSocketAddress proxyAddress, HttpCredentials proxyCredentials)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method. This call also takesHttpCredentials
to base proxy credentials along with the request.An HTTP(S) proxy is a proxy that will create one TCP connection to the HTTP(S) proxy for each target connection. The proxy transparently forwards the TCP connection to the target host.
For more information about HTTP CONNECT tunnelling see https://tools.ietf.org/html/rfc7231#section-4.3.6.
- Parameters:
proxyAddress
- (undocumented)proxyCredentials
- (undocumented)- Returns:
- (undocumented)
-
httpsProxy
public static ClientTransport httpsProxy(HttpCredentials proxyCredentials, akka.actor.ActorSystem system)
Returns aClientTransport
that runs all connection through the given HTTP(S) proxy using the HTTP CONNECT method. This method also takesHttpCredentials
in order to pass along to the proxy.Pulls the host/port pair from the application.conf: akka.client.proxy.https.{host, port}
- Parameters:
proxyCredentials
- (undocumented)system
- (undocumented)- Returns:
- (undocumented)
-
withCustomResolver
public static ClientTransport withCustomResolver(java.util.function.BiFunction<java.lang.String,java.lang.Object,java.util.concurrent.CompletionStage<java.net.InetSocketAddress>> lookup)
Returns aClientTransport
that allows to customize host name resolution.- Parameters:
lookup
- A function that will be called with hostname and port and that should (potentially asynchronously resolve the given host/port to anInetSocketAddress
- Returns:
- (undocumented)
-
fromScala
public static ClientTransport fromScala(ClientTransport scalaTransport)
-
toScala
public static ClientTransport toScala(ClientTransport javaTransport)
-
connectTo
public abstract akka.stream.javadsl.Flow<akka.util.ByteString,akka.util.ByteString,java.util.concurrent.CompletionStage<OutgoingConnection>> connectTo(java.lang.String host, int port, ClientConnectionSettings settings, akka.actor.ActorSystem system)
-
-