public class GyHttpServer extends Object implements HttpServerConfigure, ServerLifecycle
| Constructor and Description |
|---|
GyHttpServer(HttpServerProps props) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHttpPort(int port)
添加 HttpPort(当 ssl 时,可再开个 http 端口)
|
protected void |
doAddHetworkListener(String host,
int port,
boolean isMain) |
void |
enableHttp2(boolean enable) |
void |
enableSsl(boolean enable,
SSLContext sslContext)
是否允许Ssl
|
void |
enableWebSocket(boolean enableWebSocket) |
HttpServerProps |
getProps() |
boolean |
isEnableHttp2() |
boolean |
isSecure() |
boolean |
isSupportedHttp2() |
void |
setExecutor(Executor executor) |
void |
setHandler(org.noear.solon.core.handle.Handler handler) |
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, enableSslpublic GyHttpServer(HttpServerProps props)
public HttpServerProps getProps()
public void setHandler(org.noear.solon.core.handle.Handler handler)
public 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 boolean isSecure()
public void enableWebSocket(boolean enableWebSocket)
public void start(String host, int port) throws Throwable
start in interface ServerLifecycleThrowableprotected void doAddHetworkListener(String host, int port, boolean isMain) throws IOException
IOExceptionpublic void stop()
throws Throwable
stop in interface ServerLifecycleThrowableCopyright © 2025. All rights reserved.