class SmHttpServer implements ServerLifecycle {
    protected HttpServerProps props = HttpServerProps.getInstance();
    private HttpBootstrap server = null;
    private Handler handler;
    private int coreThreads;
    private Executor workExecutor;
    private boolean enableWebSocket;
    private SslConfig sslConfig = new SslConfig(ServerConstants.SIGNAL_HTTP);
    private boolean enableDebug = false;
    private boolean isSecure;

    public boolean isSecure() {
        return isSecure;
    }

    public void enableSsl(boolean enable, @Nullable SSLContext sslContext) {
        sslConfig.set(enable, sslContext);
    }

    public void enableDebug(boolean enable) {
        enableDebug = enable;
    }

    public void enableWebSocket(boolean enableWebSocket) {
        this.enableWebSocket = enableWebSocket;
    }

    public void setHandler(Handler handler) {
        this.handler = handler;
    }

    public void setWorkExecutor(Executor executor) {
        this.workExecutor = executor;
    }

    public void setCoreThreads(int coreThreads) {
        this.coreThreads = coreThreads;
    }

    @Override
    public void start(String host, int port) throws Throwable {<FILL_FUNCTION_BODY>}

    @Override
    public void stop() throws Throwable {
        if (server != null) {
            server.shutdown();
            server = null;
        }
    }
}

        server = new HttpBootstrap();
        HttpServerConfiguration _config = server.configuration();
        if (Utils.isNotEmpty(host)) {
            _config.host(host);
        }

        if (sslConfig.isSslEnable()) {
            SSLContext sslContext = sslConfig.getSslContext();

            SslPlugin<Request> sslPlugin = new SslPlugin<>(() -> sslContext, sslEngine -> {
                sslEngine.setUseClientMode(false);
            });
            _config.addPlugin(sslPlugin);
            isSecure = true;
        }

        _config.debug(enableDebug);

        _config.bannerEnabled(false);
        _config.readBufferSize(1024 * 8); //默认: 8k
        _config.threadNum(coreThreads);

        //这个是基于通讯层的。。。需要对 http 层和 ws 层分别定制
        _config.setHttpIdleTimeout((int)props.getIdleTimeoutOrDefault());

        if(enableWebSocket) {
            WebSocketServerProps wsProps = WebSocketServerProps.getInstance();
            // WS 闲置超时
            if (wsProps.getIdleTimeout() > 0) {
                _config.setWsIdleTimeout((int) wsProps.getIdleTimeout());
            }
        }


        if (ServerProps.request_maxHeaderSize > 0) {
            _config.readBufferSize(ServerProps.request_maxHeaderSize);
        }

        if (ServerProps.request_maxBodySize > 0) {
            if (ServerProps.request_maxBodySize > Integer.MAX_VALUE) {
                _config.setMaxRequestSize(Integer.MAX_VALUE);
            } else {
                _config.setMaxRequestSize((int) ServerProps.request_maxBodySize);
            }
        }


        //HttpServerConfiguration
        EventBus.publish(_config);

        SmHttpContextHandler handlerTmp = new SmHttpContextHandler(handler);
        handlerTmp.setExecutor(workExecutor);

        server.httpHandler(handlerTmp);

        if (enableWebSocket) {
            server.webSocketHandler(new SmWebSocketHandleImpl());
        }


        server.setPort(port);
        server.start();
    
<no_super_class>