简体   繁体   English

Socket.io-netty和socket.io v0.7-禁止

[英]Socket.io-netty and socket.io v0.7 - forbidden

I'm using this lib https://github.com/ibdknox/socket.io-netty . 我正在使用这个库https://github.com/ibdknox/socket.io-netty And with new socket.io catch error with this line . 并使用新的socket.io捕获此行的错误。 Looks like socket io doesn't send required headers(WEBSOCKET_PATH 137 line, FLASHSOCKET_PATH 139 line) and location was null. 看起来套接字io没有发送必需的标头(WEBSOCKET_PATH 137行,FLASHSOCKET_PATH 139行),并且位置为null。 How do I see, browser trying to get url http://127.0.0.1:8080/socket.io/1/?t=1331464323415&jsonp=0 and doesn't send any needed headers - here headers that were sent. 我怎么看,浏览器尝试获取url http://127.0.0.1:8080/socket.io/1/?t=1331464323415&jsonp=0且不发送任何所需的标头- 在此发送的标头。

What do I need to fix the problem? 我需要解决什么问题? I can't understand -_- 我不明白-_-

This is javascript clientside code: 这是javascript客户端代码:

var chat = io.connect('http://127.0.0.1:8080')

      chat.on('connect', function () {
        chat.emit('hi!');
      });

Socket.io-Netty does not support socket.io protocol higher than 0.6 . Socket.io-Netty不支持高于0.6的 socket.io协议。 You can try to use another implementation of socket.io server - https://github.com/mrniko/netty-socketio . 您可以尝试使用socket.io服务器的另一种实现-https: //github.com/mrniko/netty-socketio It supports latest protocol of socket.io. 它支持socket.io的最新协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM