Class HTTPSServer

java.lang.Object
org.languagetool.server.Server
org.languagetool.server.HTTPSServer

public class HTTPSServer extends Server
A small embedded HTTPS server that checks text. Works only with https, not with http.
Since:
2.0
See Also:
  • Field Details

  • Constructor Details

    • HTTPSServer

      public HTTPSServer(HTTPSServerConfig config, boolean runInternally, String host, Set<String> allowedIps)
      Prepare a server on the given host and port - use run() to start it.
      Parameters:
      runInternally - if true, then the server was started from the GUI.
      host - the host to bind to, e.g. "localhost" or null to bind to any host
      allowedIps - the IP addresses from which connections are allowed or null to allow any host
      Throws:
      PortBindingException - if we cannot bind to the given port, e.g. because something else is running there
  • Method Details

    • getSslContext

      private SSLContext getSslContext(File keyStoreFile, String passPhrase)
    • getConfigurator

      private com.sun.net.httpserver.HttpsConfigurator getConfigurator(SSLContext sslContext)
    • stop

      public void stop()
      Description copied from class: Server
      Stop the server. Once stopped, a server cannot be used again.
      Overrides:
      stop in class Server
    • main

      public static void main(String[] args)
    • getProtocol

      protected String getProtocol()
      Specified by:
      getProtocol in class Server