akka.http.scaladsl

HttpExt

class HttpExt extends Extension

Source
Http.scala
Linear Supertypes
Extension, AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpExt
  2. Extension
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpExt(config: Config)(implicit system: ActorSystem)

Type Members

  1. type ClientLayer = BidiFlow[HttpRequest, SslTlsOutbound, SslTlsInbound, HttpResponse, Unit]

    The type of the client-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP client.

    The type of the client-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP client.

    +------+
    HttpRequest  ~>|      |~> SslTlsOutbound
                   | bidi |
    HttpResponse <~|      |<~ SslTlsInbound
                   +------+
  2. type ServerLayer = BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, Unit]

    The type of the server-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP server.

    The type of the server-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP server.

    +------+
    HttpResponse ~>|      |~> SslTlsOutbound
                   | bidi |
    HttpRequest  <~|      |<~ SslTlsInbound
                   +------+

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (HttpExt, B)

    Implicit information
    This member is added by an implicit conversion from HttpExt to ArrowAssoc[HttpExt] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def bind(interface: String, port: Int = 1, settings: ServerSettings = ServerSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Source[IncomingConnection, Future[ServerBinding]]

    Creates a Source of IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint.

    Creates a Source of IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint. If the given port is 0 the resulting source can be materialized several times. Each materialization will then be assigned a new local port by the operating system, which can then be retrieved by the materialized ServerBinding. If the given port is non-zero subsequent materialization attempts of the produced source will immediately fail, unless the first materialization has already been unbound. Unbinding can be triggered via the materialized ServerBinding.

    If an HttpsContext is given it will be used for setting up TLS encryption on the binding. Otherwise the binding will be unencrypted.

    If no port is explicitly given (or the port value is negative) the protocol's default port will be used, which is 80 for HTTP and 443 for HTTPS.

  10. def bindAndHandle(handler: Flow[HttpRequest, HttpResponse, Any], interface: String, port: Int = 1, settings: ServerSettings = ServerSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Future[ServerBinding]

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Note that there is no backpressure being applied to the connections Source, i.e. all connections are being accepted at maximum rate, which, depending on the applications, might present a DoS risk!

  11. def bindAndHandleAsync(handler: (HttpRequest) ⇒ Future[HttpResponse], interface: String, port: Int = 1, settings: ServerSettings = ServerSettings(system), httpsContext: Option[HttpsContext] = None, parallelism: Int = 1, log: LoggingAdapter = system.log)(implicit fm: Materializer): Future[ServerBinding]

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Note that there is no backpressure being applied to the connections Source, i.e. all connections are being accepted at maximum rate, which, depending on the applications, might present a DoS risk!

  12. def bindAndHandleSync(handler: (HttpRequest) ⇒ HttpResponse, interface: String, port: Int = 1, settings: ServerSettings = ServerSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Future[ServerBinding]

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Note that there is no backpressure being applied to the connections Source, i.e. all connections are being accepted at maximum rate, which, depending on the applications, might present a DoS risk!

  13. def cachedHostConnectionPool[T](setup: HostConnectionPoolSetup)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returned Flow instances therefore remain valid throughout the lifetime of the application.

    The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem).

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  14. def cachedHostConnectionPool[T](host: String, port: Int = 80, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), log: LoggingAdapter = system.log)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returned Flow instances therefore remain valid throughout the lifetime of the application.

    The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem).

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  15. def cachedHostConnectionPoolTls[T](host: String, port: Int = 443, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Same as cachedHostConnectionPool but for encrypted (HTTPS) connections.

    Same as cachedHostConnectionPool but for encrypted (HTTPS) connections.

    If an explicit HttpsContext is given then it rather than the configured default HttpsContext will be used for encryption on the connections.

  16. def clientLayer(hostHeader: Host, settings: ClientConnectionSettings, log: LoggingAdapter = system.log): ClientLayer

    Constructs a ClientLayer stage using the given ClientConnectionSettings.

  17. def clientLayer(hostHeader: Host): ClientLayer

    Constructs a ClientLayer stage using the configured default ClientConnectionSettings.

  18. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. def defaultClientHttpsContext: HttpsContext

    Gets the current default client-side HttpsContext.

  20. def ensuring(cond: (HttpExt) ⇒ Boolean, msg: ⇒ Any): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: (HttpExt) ⇒ Boolean): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean, msg: ⇒ Any): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: Boolean): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  28. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  31. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. def newHostConnectionPool[T](setup: HostConnectionPoolSetup)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool.

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool. While the started host connection pool internally shuts itself down automatically after the configured idle timeout it will spin itself up again if more requests arrive from an existing or a new client flow materialization. The returned flow therefore remains usable for the full lifetime of the application.

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  33. def newHostConnectionPool[T](host: String, port: Int = 80, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), log: LoggingAdapter = system.log)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool.

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool. While the started host connection pool internally shuts itself down automatically after the configured idle timeout it will spin itself up again if more requests arrive from an existing or a new client flow materialization. The returned flow therefore remains usable for the full lifetime of the application.

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  34. def newHostConnectionPoolTls[T](host: String, port: Int = 443, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Same as newHostConnectionPool but for encrypted (HTTPS) connections.

    Same as newHostConnectionPool but for encrypted (HTTPS) connections.

    If an explicit HttpsContext is given then it rather than the configured default HttpsContext will be used for encryption on the connections.

  35. final def notify(): Unit

    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  37. def outgoingConnection(host: String, port: Int = 80, localAddress: Option[InetSocketAddress] = None, settings: ClientConnectionSettings = ClientConnectionSettings(system), log: LoggingAdapter = system.log): Flow[HttpRequest, HttpResponse, Future[OutgoingConnection]]

    Creates a Flow representing a prospective HTTP client connection to the given endpoint.

    Creates a Flow representing a prospective HTTP client connection to the given endpoint. Every materialization of the produced flow will attempt to establish a new outgoing connection.

  38. def outgoingConnectionTls(host: String, port: Int = 443, localAddress: Option[InetSocketAddress] = None, settings: ClientConnectionSettings = ClientConnectionSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log): Flow[HttpRequest, HttpResponse, Future[OutgoingConnection]]

    Same as outgoingConnection but for encrypted (HTTPS) connections.

    Same as outgoingConnection but for encrypted (HTTPS) connections.

    If an explicit HttpsContext is given then it rather than the configured default HttpsContext will be used for encryption on the connection.

  39. def serverLayer(settings: ServerSettings, remoteAddress: Option[InetSocketAddress] = None, log: LoggingAdapter = system.log)(implicit mat: Materializer): ServerLayer

    Constructs a ServerLayer stage using the given ServerSettings.

    Constructs a ServerLayer stage using the given ServerSettings. The returned BidiFlow isn't reusable and can only be materialized once.

  40. def serverLayer()(implicit mat: Materializer): ServerLayer

    Constructs a ServerLayer stage using the configured default ServerSettings.

    Constructs a ServerLayer stage using the configured default ServerSettings. The returned BidiFlow can only be materialized once.

  41. def setDefaultClientHttpsContext(context: HttpsContext): Unit

    Sets the default client-side HttpsContext.

  42. def shutdownAllConnectionPools(): Future[Unit]

    Triggers an orderly shutdown of all host connections pools currently maintained by the ActorSystem.

    Triggers an orderly shutdown of all host connections pools currently maintained by the ActorSystem. The returned future is completed when all pools that were live at the time of this method call have completed their shutdown process.

    If existing pool client flows are re-used or new ones materialized concurrently with or after this method call the respective connection pools will be restarted and not contribute to the returned future.

  43. def singleRequest(request: HttpRequest, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Future[HttpResponse]

    Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.

    Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.

    If an explicit HttpsContext is given then it rather than the configured default HttpsContext will be used for setting up the HTTPS connection pool, if required.

    Note that the request must have an absolute URI, otherwise the future will be completed with an error.

  44. def superPool[T](settings: ConnectionPoolSettings = ConnectionPoolSettings(system), httpsContext: Option[HttpsContext] = None, log: LoggingAdapter = system.log)(implicit fm: Materializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), Unit]

    Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URI.

    Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URI. Note that incoming requests must have an absolute URI.

    If an explicit HttpsContext is given then it rather than the configured default HttpsContext will be used for setting up HTTPS connection pools, if required.

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  46. def toString(): String

    Definition Classes
    AnyRef → Any
  47. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. def [B](y: B): (HttpExt, B)

    Implicit information
    This member is added by an implicit conversion from HttpExt to ArrowAssoc[HttpExt] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to ArrowAssoc[HttpExt] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: ArrowAssoc[HttpExt]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: Ensuring[HttpExt]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from HttpExt to StringAdd

Inherited by implicit conversion any2stringfmt from HttpExt to StringFormat

Inherited by implicit conversion any2ArrowAssoc from HttpExt to ArrowAssoc[HttpExt]

Inherited by implicit conversion any2Ensuring from HttpExt to Ensuring[HttpExt]

Ungrouped