Package io.muserver

Interface MuServer

    • Method Detail

      • stop

        void stop()
        Shuts down the server
      • uri

        java.net.URI uri()
        Returns:
        The HTTPS (or if unavailable the HTTP) URI of the web server.
      • httpUri

        java.net.URI httpUri()
        Returns:
        The HTTP URI of the web server, if HTTP is supported; otherwise null
      • httpsUri

        java.net.URI httpsUri()
        Returns:
        The HTTPS URI of the web server, if HTTPS is supported; otherwise null
      • stats

        MuStats stats()
        Returns:
        Provides stats about the server
      • activeConnections

        java.util.Set<HttpConnection> activeConnections()
        Returns:
        The current HTTP connections between this server and its clients.
      • address

        java.net.InetSocketAddress address()
        Returns:
        The address of the server. To get the ip address, use InetSocketAddress.getAddress() and on that call InetAddress.getHostAddress(). To get the hostname, use InetSocketAddress.getHostName() or InetSocketAddress.getHostString().
      • artifactVersion

        static java.lang.String artifactVersion()
        Returns:
        Returns the current version of MuServer, or 0.x if unknown
      • maxRequestHeadersSize

        int maxRequestHeadersSize()
        The maximum allowed size of request headers.

        This can only be set at point of server creation with MuServerBuilder.withMaxHeadersSize(int)

        Returns:
        Size in bytes.
      • requestIdleTimeoutMillis

        long requestIdleTimeoutMillis()
        The maximum idle timeout for reading request bodies.

        This can only be set at point of server creation with MuServerBuilder.withIdleTimeout(long, TimeUnit)

        Returns:
        Timeout in milliseconds.
      • maxRequestSize

        long maxRequestSize()
        The maximum allowed size of a request body.

        This can only be set at point of server creation with MuServerBuilder.withMaxRequestSize(long)

        Returns:
        Size in bytes.
      • maxUrlSize

        int maxUrlSize()
        The maximum allowed size of the URI sent in a request line.

        This can only be set at point of server creation with MuServerBuilder.withMaxUrlSize(int)

        Returns:
        Length of allowed URI string.
      • mimeTypesToGzip

        java.util.Set<java.lang.String> mimeTypesToGzip()
        Specifies the mime-types that GZIP should be applied to.

        This can only be set at point of server creation with MuServerBuilder.withGzip(long, Set)

        Returns:
        A set of mime-types.
      • changeHttpsConfig

        void changeHttpsConfig​(HttpsConfigBuilder newHttpsConfig)
        Changes the HTTPS certificate. This can be changed without restarting the server.
        Parameters:
        newHttpsConfig - The new SSL Context to use.
      • sslInfo

        SSLInfo sslInfo()
        Gets the SSL info of the server, or null if SSL is not enabled.
        Returns:
        A description of the actual SSL settings used, or null.