Package org.languagetool.server
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:
HTTPServer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.languagetool.server.Server
Server.StoppingThreadPoolExecutor
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ExecutorService
executorService
-
Fields inherited from class org.languagetool.server.Server
DEFAULT_ALLOWED_IPS, host, httpHandler, port, server
-
-
Constructor Summary
Constructors Constructor Description HTTPSServer(HTTPSServerConfig config, boolean runInternally, java.lang.String host, java.util.Set<java.lang.String> allowedIps)
Prepare a server on the given host and port - use run() to start it.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private com.sun.net.httpserver.HttpsConfigurator
getConfigurator(javax.net.ssl.SSLContext sslContext)
protected java.lang.String
getProtocol()
private javax.net.ssl.SSLContext
getSslContext(java.io.File keyStoreFile, java.lang.String passPhrase)
static void
main(java.lang.String[] args)
void
stop()
Stop the server.-
Methods inherited from class org.languagetool.server.Server
checkForNonRootUser, getErrorRequestLimiterOrNull, getExecutorService, getRequestLimiterOrNull, isRunning, printCommonConfigFileOptions, printCommonOptions, run, usageRequested
-
-
-
-
Constructor Detail
-
HTTPSServer
public HTTPSServer(HTTPSServerConfig config, boolean runInternally, java.lang.String host, java.util.Set<java.lang.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 Detail
-
getSslContext
private javax.net.ssl.SSLContext getSslContext(java.io.File keyStoreFile, java.lang.String passPhrase)
-
getConfigurator
private com.sun.net.httpserver.HttpsConfigurator getConfigurator(javax.net.ssl.SSLContext sslContext)
-
stop
public void stop()
Description copied from class:Server
Stop the server. Once stopped, a server cannot be used again.
-
main
public static void main(java.lang.String[] args)
-
getProtocol
protected java.lang.String getProtocol()
- Specified by:
getProtocol
in classServer
-
-