Solon 框架,想要使用 http2 怎么办?

要使用支持 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); 
            });
        });
    }
}

猜你喜欢

转载自blog.csdn.net/cwzb/article/details/131663218