HTTPSPDYServerConnector尚未更新为ALPN,并且当前对NPN的使用进行了硬编码。
为了在SPDY中使用ALPN,您必须以
ServerConnector这种方式配置a :
SslContextFactory sslContextFactory = new SslContextFactory();HttpConfiguration httpConfig = new HttpConfiguration();SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory, "alpn");ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory("spdy/3", "http/1.1");alpn.setDefaultProtocol("http/1.1");HTTPSPDYServerConnectionFactory spdy = new HTTPSPDYServerConnectionFactory(SPDY.V3, httpConfig);HttpConnectionFactory http = new HttpConnectionFactory(httpConfig);Server server = new Server();ServerConnector connector = new ServerConnector(server, new ConnectionFactory[]{ssl, alpn, spdy, http});server.start();我将其跟踪为https://bugs.eclipse.org/bugs/show_bug.cgi?id=440756。
最后,如果您不直接使用代码,而是将Jetty用作服务器并将Webapp部署到该服务器,则Jetty已经根据激活的模块正确配置了ALPN或NPN。



