public class UndertowServer extends Object implements ServerLifecycle
| Modifier and Type | Field and Description |
|---|---|
protected io.undertow.Undertow |
_server |
protected Set<Integer> |
addHttpPorts |
protected boolean |
enableHttp2 |
protected boolean |
enableWebSocket |
protected boolean |
isSecure |
protected HttpServerProps |
props |
protected SslConfig |
sslConfig |
| Constructor and Description |
|---|
UndertowServer(HttpServerProps props) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHttpPort(int port)
添加 HttpPort(当 ssl 时,可再开个 http 端口)
|
protected io.undertow.server.HttpHandler |
buildHandler() |
void |
enableHttp2(boolean enable) |
void |
enableSsl(boolean enable,
SSLContext sslContext)
是否允许Ssl
|
void |
enableWebSocket(boolean enableWebSocket) |
HttpServerProps |
getProps() |
protected String |
getResourceRoot() |
protected URL |
getRootPath() |
protected io.undertow.servlet.api.DeploymentInfo |
initDeploymentInfo() |
boolean |
isEnableHttp2() |
boolean |
isSecure() |
boolean |
isSupportedHttp2() |
void |
setExecutor(Executor executor) |
protected void |
setup(String host,
int port) |
void |
start(String host,
int port) |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenableDebug, enableSslprotected io.undertow.Undertow _server
protected boolean isSecure
protected boolean enableWebSocket
protected final HttpServerProps props
protected SslConfig sslConfig
protected boolean enableHttp2
public UndertowServer(HttpServerProps props)
public boolean isSecure()
public void enableWebSocket(boolean enableWebSocket)
public void start(String host, int port)
start in interface ServerLifecyclepublic void stop()
throws Throwable
stop in interface ServerLifecycleThrowableprotected io.undertow.server.HttpHandler buildHandler()
throws Exception
Exceptionpublic void enableSsl(boolean enable,
@Nullable
SSLContext sslContext)
enableSsl in interface HttpServerConfigurepublic boolean isSupportedHttp2()
isSupportedHttp2 in interface HttpServerConfigurepublic void enableHttp2(boolean enable)
enableHttp2 in interface HttpServerConfigurepublic boolean isEnableHttp2()
public void addHttpPort(int port)
addHttpPort in interface HttpServerConfigurepublic void setExecutor(Executor executor)
setExecutor in interface HttpServerConfigurepublic HttpServerProps getProps()
protected io.undertow.servlet.api.DeploymentInfo initDeploymentInfo()
protected String getResourceRoot() throws FileNotFoundException
FileNotFoundExceptionprotected URL getRootPath()
Copyright © 2025. All rights reserved.