我试着在我的webapp上使用http/2。问题是,我的websocket连接在使用http/2时似乎无法工作。
我在var webSocket = new WebSocket('wss://xxx.de:8443/urlto/websocket');中使用javascript文件
我在server.xml中的Tomcat连接器看起来像这样:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="/path/to/privkey.pem"
certificateFile="/path/to/cert.pem"
certificateChainFile="/path/to/chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>以这样的方式启动服务器时,我收到一个错误,提示connection closed before receiving a handshake response
如果我不包含<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />部件,则websocket连接没有问题。
https://stackoverflow.com/questions/47598332
复制相似问题