WebSocket handshake: Unexpected response code: 404
在执行 http://www.cnblogs.com/best/p/5695570.html 提供的 websocket时候,
报错了 “WebSocket handshake: Unexpected response code: 404”。
最终发现是因为建立 socket对象的url不对
socket = new WebSocket("ws://127.0.0.1:8080/ws/eee");
正确的应该是:
socket = new WebSocket("ws://127.0.0.1:8080/WebSocketServer/ws/eee");
在服务端 是@ServerEndpoint("/ws/{user}"),但客户端要把项目名称”WebSocketServer”添加到路径里。
WebSocket handshake: Unexpected response code: 404的更多相关文章
- WebSocket connection to,Error during WebSocket handshake: Unexpected response code: 404
使用标准的JSR 356注解时,需要使用tomcat 8.x版本,如果使用tomcat 7.x的版本,则需要继承WebSocketServlet,否则会报WebSocket connection to ...
- struts2+websocket报错:failed: Error during WebSocket handshake: Unexpected response code:404
最近把websocket集成进项目里面来,打开网页总是会遇到这样的错误. 网上说的原因有3种,但是都不适合我,但是也记录下. 1.struts2截拦掉了ws的请求.这种援用可以尝试把web.xml清空 ...
- nginx反向代理 报错:Error during WebSocket handshake: Unexpected response code: 403
遇到nginx报错:websocket wss failed: Error during WebSocket handshake: Unexpected response code: 403 serv ...
- easyswoole报错:failed: Error during WebSocket handshake: Unexpected response code: 200
WebSocket connection to 'ws://www.xxxx.com/xxx/xx' failed: Error during WebSocket handshake: Unexpec ...
- Spring 整合WebSocket, Error during WebSocket handshake: Unexpected response code: 302 还有200的错误
springboot 集成websocket 及其简单,,,但是管理端使用的是Spring,原生配置,发生这个错误,,,302 被重定向了...我起的是本地locallhost,把ip换成 local ...
- vue-cli 安装失败Failed to download repo vuejs-templates/vuedemo: Response code 404 (Not Found)
还原问题现场: 第一次使用vue init webpack projectName的时候,由于操作失误,执行了两次npm install -g vue-cli,然后再使用vue init webpac ...
- Vue脚手架创建项目出现 (Failed to download repo vuejs-templates/webpack: Response code 404)
搭建好(脚手架2.X版本)环境像往常一样使用vue init webpack xxxx 创建项目可以是没多久就开始报错了 报错结果就是:vue-cli · Failed to download rep ...
- vue-cli 安装失败Failed to download repo vuejs-templates/webapck-simple: Response code 404 (Not Found)
新学习vue的萌新们经常会遇到各种各样的坑.例如上面这个报错.这个一般是命令行面板写错单词导致. 正确:vue init webpack-simple .(注意"."点,指当前目录 ...
- Spring websocket浏览器连接时出现404错误
1.场景 在用websocket做一个简单的数据导入页面同步显示后台进度功能的时候,浏览器出现连接不上的错误: WebSocket connection to 'ws://localhost:8080 ...
随机推荐
- nyoj--18--The Triangle(dp水题)
The Triangle 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure ...
- VC下加载多种格式图片的方法总结IPicture, CxImage, CImage(AtlImage), CPictureEx
尽管VC有提供相应的API和类来操作bmp位图.图标和(增强)元文件,但却不支持jpg.gif和png等格式的图片,而这几种格式却是常常要用到的.这里我给大家介绍两种办法来操作这些格式的图片. 1.用 ...
- handsontable在线编辑excel扩展功能-踩坑篇
简述 先说一下背景,之所以封装handsontable插件,是因为公司要实现在线编辑导入excel文件的功能,然后我就找到了这个功能强大的插件handsontable. 具体功能 除了handsont ...
- 读 Real-Time Rendering 收获 - chapter 4. transform
chapter 4. Transform p54 affine transform p57 all rotation matrices have a determinant of one and ar ...
- Ubuntu 14.04下安装CUDA8.0
配置环境如下: 系统:Ubuntu14.04 64bit 显卡:Nvidia K620M 显卡驱动:Nvidia-Linux-x86_64-375.66.run CUDA8.0 + cudnn8.0 ...
- [Java] Protect, Private and Public的区别
Java中的private.protected.public和default的区别 (2014-03-21 22:29:14) 转载▼ 标签: java java修饰符 it (1)对于publi ...
- rsyslog 存储到 mysql
输出Host1/2的系统日志, 记录到mysql服务器数据库中, 并发布loganalyzer 结构关系如下图: 思路: 通过远程连接mysql, 使得rsyslog的log记录能够写入到mysql中 ...
- 转义JavaScript特殊字符
JavaScriptUtils.javaScriptEscape("%admin' or '1=1") //转义JavaScript特殊字符
- redis 篇 - 键 and string
redis 进入控制台 redis-cil 需要输入密码的时候可以是用 -a redis-cil -a abcd1234 redis 数据类型 string hash list set zset( 有 ...
- docker系列之一 image和container
docker images往往不知不觉就占满了硬盘空间,为了清理冗余的image,可采用以下方法: 1.进入root权限 sudo su 2.停止所有的container,这样才能够删除其中的imag ...