Package org.languagetool.server
Class HTTPSServer
java.lang.Object
org.languagetool.server.Server
org.languagetool.server.HTTPSServer
A small embedded HTTPS server that checks text. Works only with https, not with http.
- Since:
- 2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.languagetool.server.Server
Server.StoppingThreadPoolExecutor
-
Field Summary
FieldsFields inherited from class org.languagetool.server.Server
DEFAULT_ALLOWED_IPS, host, httpHandler, port, server
-
Constructor Summary
ConstructorsConstructorDescriptionHTTPSServer
(HTTPSServerConfig config, boolean runInternally, String host, Set<String> allowedIps) Prepare a server on the given host and port - use run() to start it. -
Method Summary
Modifier and TypeMethodDescriptionprivate com.sun.net.httpserver.HttpsConfigurator
getConfigurator
(SSLContext sslContext) protected String
private SSLContext
getSslContext
(File keyStoreFile, String passPhrase) static void
void
stop()
Stop the server.Methods inherited from class org.languagetool.server.Server
checkForNonRootUser, getErrorRequestLimiterOrNull, getExecutorService, getRequestLimiterOrNull, isRunning, printCommonConfigFileOptions, printCommonOptions, run, usageRequested
-
Field Details
-
executorService
-
-
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"
ornull
to bind to any hostallowedIps
- the IP addresses from which connections are allowed ornull
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
-
getConfigurator
-
stop
public void stop()Description copied from class:Server
Stop the server. Once stopped, a server cannot be used again. -
main
-
getProtocol
- Specified by:
getProtocol
in classServer
-