Packages

t

akka.http.scaladsl

ServerBuilder

trait ServerBuilder extends AnyRef

Builder API to create server bindings.

Use HttpExt.newServerAt() to create a builder, use methods to customize settings, and then call one of the bind* methods to bind a server.

Source
ServerBuilder.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerBuilder
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def adaptSettings(f: (ServerSettings) => ServerSettings): ServerBuilder

    Adapt the current configured settings with a function.

  2. abstract def bind(f: (HttpRequest) => Future[HttpResponse]): Future[ServerBinding]

    Bind a new HTTP server at the given endpoint and use the given asynchronous handler akka.stream.scaladsl.Flow for processing all incoming connections.

    Bind a new HTTP server at the given endpoint and use the given asynchronous handler akka.stream.scaladsl.Flow for processing all incoming connections.

    The number of concurrently accepted connections can be configured by overriding the akka.http.server.max-connections setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

    Supports HTTP/2 on the same port if http2 support is enabled.

  3. abstract def bindFlow(handlerFlow: Flow[HttpRequest, HttpResponse, _]): Future[ServerBinding]

    Binds a new HTTP server at the given endpoint and uses the given handler akka.stream.scaladsl.Flow for processing all incoming connections.

    Binds a new HTTP server at the given endpoint and uses the given handler akka.stream.scaladsl.Flow for processing all incoming connections.

    The number of concurrently accepted connections can be configured by overriding the akka.http.server.max-connections setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

  4. abstract def bindSync(f: (HttpRequest) => HttpResponse): Future[ServerBinding]

    Bind a new HTTP server at the given endpoint and uses the given handler akka.stream.scaladsl.Flow for processing all incoming connections.

    Bind a new HTTP server at the given endpoint and uses the given handler akka.stream.scaladsl.Flow for processing all incoming connections.

    The number of concurrently accepted connections can be configured by overriding the akka.http.server.max-connections setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

    Supports HTTP/2 on the same port if http2 support is enabled.

  5. abstract def connectionSource(): Source[IncomingConnection, Future[ServerBinding]]

    Creates a akka.stream.scaladsl.Source of akka.http.scaladsl.Http.IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint.

    Creates a akka.stream.scaladsl.Source of akka.http.scaladsl.Http.IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint.

    Note that each materialization will create a new binding, so

    * if the configured 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 akka.http.scaladsl.Http.ServerBinding.

    * if the configured 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 akka.http.scaladsl.Http.ServerBinding.

  6. abstract def enableHttps(context: HttpsConnectionContext): ServerBuilder

    Enable HTTPS for this binding with the given context.

  7. abstract def logTo(log: LoggingAdapter): ServerBuilder

    Use a custom logger

  8. abstract def onInterface(interface: String): ServerBuilder

    Change interface to bind to

  9. abstract def onPort(port: Int): ServerBuilder

    Change port to bind to

  10. abstract def withMaterializer(materializer: Materializer): ServerBuilder

    Use custom Materializer for the binding

  11. abstract def withSettings(settings: ServerSettings): ServerBuilder

    Use custom ServerSettings for the binding.