【问题标题】:Prevent Tomcat from sending header "Connection: close"防止 Tomcat 发送标头“连接:关闭”
【发布时间】:2018-11-04 20:21:55
【问题描述】:

我的 Tomcat Websocket 服务器在通过 https 的连接的回复标头中具有双重属性“连接”:“升级”和“关闭”。不适用于通过 http 的连接,此处仅用于“升级”。这将导致 Safari 断开连接。如何防止“连接:关闭”出现在标题中?

连接器配置:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="" keystorePass="" />

【问题讨论】:

  • 我可以在设置了“Connection: close”的地方创建一个自定义的 AbstractHttp11Processor 实现吗?我使用 Tomcat 7.0.76。
  • 分享你的Connector配置
  • 通过https连接网页没有问题,但是通过wss的websocket不工作。

标签: ssl websocket safari tomcat7 java-websocket


【解决方案1】:

我可以通过更改为 Tomcat 9.0.8 来解决该问题。我继续使用相同的连接器配置。

【讨论】:

    猜你喜欢
    • 2017-01-21
    • 2011-04-05
    • 1970-01-01
    • 2018-05-04
    • 1970-01-01
    • 1970-01-01
    • 2017-04-05
    • 2012-12-10
    • 1970-01-01
    相关资源
    最近更新 更多