使用apache代理生成的wss服务常出现 Error during WebSocket handshake: net::ERR_RESPONSE_HEADERS_TRUNCATED 的问题,但多刷新几次页面就能连接成功

在官方文档没找到办法,最后在https://github.com/ratchetphp/Ratchet/issues/645找到了解决方案

这个不是Workerman的仓库,但解决办法是通用的

I could say that when some client disconnects without default websockt close protocol, ratchet keeps the connection "open", but when a new user connects then ratchet reuses somehow the last "open"(closed) connection...

Because the new client uses a old "active" connection, when it sends the HTTP handshake, ratchet complains because it isn't the default message frame.

是连接的重用导致了这个问题

修改apache的配置文件 conf.d/ssl.conf

在反向代理中增加一个配置 disablereuse=On,问题解决了

ProxyPass /wss ws://127.0.0.1:8282/wss disablereuse=On
ProxyPassReverse /wss ws://127.0.0.1:8282/wss

参考连接

  1. https://github.com/ratchetphp/Ratchet/issues/645
  2. http://doc.workerman.net/faq/secure-websocket-server.html

[Note] 解决使用Workerman和apache创建wss服务时出现的 Error during WebSocket handshake: net::ERR_RESPONSE_HEADERS_TRUNCATED的更多相关文章

  1. node.js 创建 wss服务

    var https=require('https'); var ws=require('ws'); var fs=require('fs'); var keypath=process.cwd()+'/ ...

  2. 记载idea创建spring-boot项目时“Spring Initalizr Error”的问题处理

  3. 创建Android项目时出错——No resource found that matches the given name 'Theme.AppCompat.Light'

    创建Android项目时出错,error: Error retrieving parent for item: No resource found that matches the given nam ...

  4. 使用ASP.NET web API创建REST服务(二)

    Creating a REST service using ASP.NET Web API A service that is created based upon the architecture ...

  5. 使用ASP.NET web API创建REST服务(三)

    本文档来源于:http://www.cnblogs.com/madyina/p/3390773.html Creating a REST service using ASP.NET Web API A ...

  6. Nginx或Apache通过反向代理配置wss服务

    nginx配置参考 前提条件及准备工作: 1.假设ws服务监听的是8282端口(websocket协议) 2.已经申请了证书(pem/crt文件及key文件)放在了/etc/nginx/conf.d/ ...

  7. Linux系统安装workerman,启动wss 服务

    安装workerman其实很简单,只要会简单的linux口令就可以搞定, 这里我给大家演示一下如何安装workerman 进入终端的过程就不用演示了吧... 输入root及密码进入终端后找到站点根目录 ...

  8. phoenix连接hbase数据库,创建二级索引报错:Error: org.apache.phoenix.exception.PhoenixIOException: Failed after attempts=36, exceptions: Tue Mar 06 10:32:02 CST 2018, null, java.net.SocketTimeoutException: callTimeou

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...

  9. 创建maven项目时pom.xml报错的解决方法

    创建maven项目时pom.xml时: 出现如下报错信息: Failure to transfer commons-lang:commons-lang:jar:2.1 from https://rep ...

随机推荐

  1. 不修改的主席(HJT)树-HDU2665,POJ-2104;

    参考:优秀的B站视频:   和 https://blog.csdn.net/creatorx/article/details/75446472 感觉主席树这个思路是真的优秀,每次在前一次的线段树的基础 ...

  2. GNU大型项目构建和覆盖率生成(第一篇)

    目录 0. 序言 1. 项目描述 2. 项目构建 2.1 编译规则 2.2 构建过程 3. 覆盖率分析 0. 序言 在开始正文之前,请允许我先说明一下本文的目的和写作的动机,好让读者不惑. 我们知道, ...

  3. mybatis转义

    SELECT * FROM test WHERE 1 = 1 AND start_date <= CURRENT_DATE AND end_date >= CURRENT_DATE 在执行 ...

  4. 深度剖析Vue中父给子、子给父、兄弟之间传值!

    本片文章将为您详细讲解在Vue中,父给子传值.子给父传值以及兄弟之间传值方式! 父传子:父组件 // template里面 <aa :info="name"/> // ...

  5. 5分钟了解lucene全文索引

    一.Lucene介绍及应用 Apache Lucene是当下最为流行的开源全文检索工具包,基于JAVA语言编写. 目前基于此工具包开源的搜索引擎,成熟且广为人知的有Solr和Elasticsearch ...

  6. java多线程之Executor框架

    Executor框架简介 Executor框架的结构 Executor框架主要由3大部分组成: 任务: 包括被执行的任务需要实现的接口:Runable 接口.Callable接口: 任务的执行: 包括 ...

  7. 4.cache每个参数的意义和作用以及工作原理?

    在程序开发过程中,适当使用 Cache 缓存能有效提高程序执行效率.比如一些常常调用的系统公共变量,把它们缓存到 Cache 中,当需要使用它们时,直接从 Cache 中读取,不必每次都从数据库或文件 ...

  8. 四大组件初始之Broadcast

    在进行应用设计时,需要获取很多环境参数,像电量,音量,亮度,网络等.相比较每次去询问android这些信息改变了吗.让Android告诉我们,这些信息改变了更加合理.只要这些信息改变,Android通 ...

  9. 【转载】pandas中的循环

    原始文章链接: https://towardsdatascience.com/how-to-make-your-pandas-loop-71-803-times-faster-805030df4f06 ...

  10. 记一次Mysql数据库Kill完之后启动不起来的解决方案

    在Mysql运行的时候,有时候会stop不了,这时候我们就会想直接把他的进程kill掉. 但是,有时候kill完了之后,在去start它就会直接抛异常了... ERROR! The server qu ...