Interface ServerBuilder
Use {@link HttpExt.newServerAt()} to create a builder, use methods to customize settings, and then call one of the bind* methods to bind a server.
- 
Method SummaryModifier and TypeMethodDescriptionadaptSettings(scala.Function1<ServerSettings, ServerSettings> f) Adapt the current configured settings with a function.scala.concurrent.Future<Http.ServerBinding>bind(scala.Function1<HttpRequest, scala.concurrent.Future<HttpResponse>> f) Bind a new HTTP server at the given endpoint and use the given asynchronoushandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.scala.concurrent.Future<Http.ServerBinding>bindFlow(org.apache.pekko.stream.scaladsl.Flow<HttpRequest, HttpResponse, ?> handlerFlow) Binds a new HTTP server at the given endpoint and uses the givenhandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.scala.concurrent.Future<Http.ServerBinding>bindSync(scala.Function1<HttpRequest, HttpResponse> f) Bind a new HTTP server at the given endpoint and uses the givenhandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.org.apache.pekko.stream.scaladsl.Source<Http.IncomingConnection,scala.concurrent.Future<Http.ServerBinding>> Creates apekko.stream.scaladsl.Sourceofpekko.http.scaladsl.Http.IncomingConnectioninstances which represents a prospective HTTP server binding on the givenendpoint.enableHttps(HttpsConnectionContext context) Enable HTTPS for this binding with the given context.logTo(org.apache.pekko.event.LoggingAdapter log) Use a custom loggeronInterface(String interface_) Change interface to bind toonPort(int port) Change port to bind towithMaterializer(org.apache.pekko.stream.Materializer materializer) Use customMaterializerfor the bindingwithSettings(ServerSettings settings) Use customServerSettingsfor the binding.
- 
Method Details- 
onInterfaceChange interface to bind to
- 
onPortChange port to bind to
- 
logToUse a custom logger
- 
withSettingsUse customServerSettingsfor the binding.- Parameters:
- settings- (undocumented)
- Returns:
- (undocumented)
 
- 
adaptSettingsAdapt the current configured settings with a function.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
enableHttpsEnable HTTPS for this binding with the given context.- Parameters:
- context- (undocumented)
- Returns:
- (undocumented)
 
- 
withMaterializerUse customMaterializerfor the binding- Parameters:
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
bindscala.concurrent.Future<Http.ServerBinding> bind(scala.Function1<HttpRequest, scala.concurrent.Future<HttpResponse>> f) Bind a new HTTP server at the given endpoint and use the given asynchronoushandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the pekko.http.server.max-connectionssetting. 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. - Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
bindSyncBind a new HTTP server at the given endpoint and uses the givenhandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the pekko.http.server.max-connectionssetting. 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. - Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
bindFlowscala.concurrent.Future<Http.ServerBinding> bindFlow(org.apache.pekko.stream.scaladsl.Flow<HttpRequest, HttpResponse, ?> handlerFlow) Binds a new HTTP server at the given endpoint and uses the givenhandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the pekko.http.server.max-connectionssetting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.- Parameters:
- handlerFlow- (undocumented)
- Returns:
- (undocumented)
 
- 
connectionSourceorg.apache.pekko.stream.scaladsl.Source<Http.IncomingConnection,scala.concurrent.Future<Http.ServerBinding>> connectionSource()Creates apekko.stream.scaladsl.Sourceofpekko.http.scaladsl.Http.IncomingConnectioninstances which represents a prospective HTTP server binding on the givenendpoint.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 pekko.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 pekko.http.scaladsl.Http.ServerBinding.- Returns:
- (undocumented)
 
 
-