开发者社区> 问答> 正文

WebSocket 和netty交互信息的问题?报错

netty和ios进行信息推送,通过websocket,目前可以推送到苹果手机上了,但是查看服务端日志,总是报这个错误,另外,我用netty4.0.23版本,请求帮助

错误信息

  An exception was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: not a WebSocket handshake request: missing upgrade

报错代码位置在标红处:

WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                 getWebSocketLocation(req), null, false);
         handshaker = wsFactory.newHandshaker(req);
         if (handshaker == null) {
             WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());
         } else {
              handshaker.handshake(ctx.channel(), req);
         }

展开
收起
爱吃鱼的程序员 2020-06-14 20:29:41 1030 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    这个问题没人回答呀问题解决了吗Iwanttoknowthisissueisresolvedyet

    2020-06-14 20:29:57
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载