使用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. shell中日期循环的方式

    第一种 # 这里的例子以周为循环 !/bin/bash begin_date="20160907" end_date="20170226" while [ &q ...

  2. 【Offer】[34] 【二叉树中和为某一值的路径】

    题目描述 思路分析 测试用例 Java代码 代码链接 题目描述 输入一棵二叉树和一个整数,打印出二叉树中节点值的和为输入整数的所有路径.从树的根节点开始往下一直到叶节点所经过的节点形成一条路径.  ...

  3. 每天学会一点点(map常量)

    map常用的声明方式(使用静态代码块): public final static Map map = new HashMap(); static { map.put("key1", ...

  4. java教程系列一:什么是Java语言?

    海上生明月,天涯共此时. Java是一种通用的计算机编程语言,它具有卓越的通用性.高效性.平台移植性和安全性.它旨在让应用程序开发人员"write once, run anywhere&qu ...

  5. 重学Java(一):与《Java编程思想》的不解之缘

    说起来非常惭愧,我在 2008 年的时候就接触了 Java,但一直到现在(2018 年 10 月 10 日),基础知识依然非常薄弱.用一句话自嘲就是:十年 IT 老兵,Java 菜鸡一枚. 于是,我想 ...

  6. Ubuntu18.04安装测试TensorFlow-GPU

    1 安装Ubuntu18.04.03 lts spt@spt-ts:~$ lsb_release -a No LSB modules are available. Distributor ID: Ub ...

  7. TestNG(三) 基本注解BeforeMethod和AfterMethod

    package com.course.testng; import org.testng.annotations.*; public class BasicAnnotation { @Test //最 ...

  8. [Pandas] 06 - Data Preprocessing and Cleaning

    From: DBWangGroup 基于该系列代码的实践与补充思考. 补充:特征工程 结合:[Scikit-learn] 4.3. Preprocessing data /* implement */

  9. 搭建Android+QT+OpenCV环境,实现“单色图片着色”效果

               OpenCV是我们大家非常熟悉的图像处理开源类库:在其新版本将原本在Contrib分库中的DNN模块融合到了主库中,并且更新了相应文档.这样我们就能够非常方便地利用OpenCV实 ...

  10. Properties -IO相关的双列集合类

    IO相关的集合类 java.util.Properties集合 extends hashtable(淘汰) Properties类表示了一个持久的属性集.Properties可保存流中或从流中加载 P ...