Package | Description |
---|---|
io.muserver |
This package contains the main API of mu-server, for example the server builders, request and response objects.
|
Modifier and Type | Method and Description |
---|---|
MuServerBuilder |
MuServerBuilder.addAsyncHandler(AsyncMuHandler handler)
Deprecated.
For async handling, add a normal
MuHandler and call MuRequest.handleAsync() |
MuServerBuilder |
MuServerBuilder.addHandler(Method method,
String uriTemplate,
RouteHandler handler)
Registers a new handler that will only be called if it matches the given route info
|
MuServerBuilder |
MuServerBuilder.addHandler(MuHandler handler)
Adds a request handler.
|
MuServerBuilder |
MuServerBuilder.addHandler(MuHandlerBuilder handler)
Adds a request handler.
|
MuServerBuilder |
MuServerBuilder.addShutdownHook(boolean stopServerOnShutdown) |
static MuServerBuilder |
MuServerBuilder.httpServer()
Creates a new server builder which will run as HTTP on a random port.
|
static MuServerBuilder |
MuServerBuilder.httpsServer()
Creates a new server builder which will run as HTTPS on a random port.
|
static MuServerBuilder |
MuServerBuilder.muServer()
Creates a new server builder.
|
MuServerBuilder |
MuServerBuilder.withGzip(long minimumGzipSize,
Set<String> mimeTypesToGzip)
Enables gzip for files of at least the specified size that match the given mime-types.
|
MuServerBuilder |
MuServerBuilder.withGzipEnabled(boolean enabled)
Enables gzip for certain resource types.
|
MuServerBuilder |
MuServerBuilder.withHandlerExecutor(ExecutorService executor)
Sets the thread executor service to run requests on.
|
MuServerBuilder |
MuServerBuilder.withHttp2Config(Http2Config http2Config)
Sets the configuration for HTTP2
|
MuServerBuilder |
MuServerBuilder.withHttp2Config(Http2ConfigBuilder http2Config)
Sets the configuration for HTTP2
|
MuServerBuilder |
MuServerBuilder.withHttpConnection(int port)
Deprecated.
Use
withHttpPort(int) instead |
MuServerBuilder |
MuServerBuilder.withHttpDisabled()
Deprecated.
It is off by default so this is not needed.
|
MuServerBuilder |
MuServerBuilder.withHttpPort(int port) |
MuServerBuilder |
MuServerBuilder.withHttpsConfig(SSLContext sslContext)
Sets the HTTPS config.
|
MuServerBuilder |
MuServerBuilder.withHttpsConfig(SSLContextBuilder sslContext)
Sets the HTTPS config.
|
MuServerBuilder |
MuServerBuilder.withHttpsConnection(int port,
SSLContext sslEngine)
Deprecated.
use
withHttpsPort(int) and withHttpsConfig(SSLContext) instead. |
MuServerBuilder |
MuServerBuilder.withHttpsPort(int port)
Sets the HTTPS port to use.
|
MuServerBuilder |
MuServerBuilder.withIdleTimeout(long duration,
TimeUnit unit)
Sets the idle timeout for requests and responses.
|
MuServerBuilder |
MuServerBuilder.withInterface(String host)
Use this to specify which network interface to bind to.
|
MuServerBuilder |
MuServerBuilder.withMaxHeadersSize(int size)
Specifies the maximum size in bytes of the HTTP request headers.
|
MuServerBuilder |
MuServerBuilder.withMaxUrlSize(int size)
The maximum length that a URL can be.
|
Copyright © 2017–2019. All rights reserved.