Solon v2.7.6

想要使用 http2 怎么办

</> markdown

要使用支持 http2 的插件:solon.boot.undertow (目前,只有它支持)

@SolonMain
public class SeverDemo {
    public static void main(String[] args) {
        Solon.start(SeverDemo.class, args, app -> {
            app.onEvent(HttpServerConfigure.class, e -> {
                //通过事件,启用 http2
                e.enableHttp2(true); //v2.3.8 后支持
            });
        });
    }
}