微信小程序WebSocket报错:Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received
2018-03-18 22:32
537 查看
Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received
WebSocket握手阶段出错:发送了非空“Sec-WebSocket-Protocol”请求头但是响应中没有此字段
这个,在后端握手时设置一下请求头(Sec-WebSocket-Protocol)即可,前端发来什么值,这里就写什么值
测试:
在Chrome控制台输入 var ws = new WebSocket("ws:xx.xx.com","chat"),chat就是Sec-WebSocket-Protocol的值,协议名
相关文章推荐
- SharePoint Error - An unrecognized HTTP response was received when attempting to crawl this item
- Android studio打包apk的时候报错Android Error:Error: Expected a color resource id (R.color.) but received an
- 火狐浏览器扩展插件报错sec_error_ocsp_old_response解决办法
- SQL - A connection was successfully established with the server, but then an error occurred during the pre-login handsha
- STM32报错、报错状况以及解决办法:Library reports error: __use_no_semihosting was requested, but _ttywrch was refer
- SharePoint Error - An unrecognized HTTP response was received when attempting to crawl this item
- SSMS错误:A connection was successfully established with the server, but then an error occurred during the login process
- Security:090476]Invalid/unknown SSL header was received from peer locahost during SSL handshake
- Android中有时候运行程序的时候会报错:An internal error occurred during:。。。。
- 关于response.setHeader("Cache-Control","no-cache");(转载)
- 报错:No principal was found in the response from the CAS server
- the module '*' was loaded but the call to DllRegisterServer failed with error 0x80004005
- Scrapy报错Error: 'module' object has no attribute 'OP_SINGLE_ECDH_USE'
- Android-Bug修复--java.lang.NoSuchFieldError: Toolbar_buttonGravity
- error opening trace file: No such file or directory (2)报错原因
- error Received malformed response from registry for undefined. The registry may be down.
- 【微信小程序】POST .......net::ERR_SSL_PROTOCOL_ERROR
- AndroidStudio运行程序提示Error running app : No target device found
- A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
- coreseek _error received zero-sized searchd response