握手期间的套接字IO意外响应代码400

时间:2014-11-06 04:46:52

标签: node.js sockets socket.io

WebSocket connection to 'ws:// failed: 
Error during WebSocket handshake: 
Unexpected response code: 400 socket.io-1.2.0.js:2

对此有任何建议,无论研究如何,我都无法找到解决此问题的方法, 任何想法在这方面出了什么问题以及如何解决

Node.js的

    app.use(function(request, response, next){
        response.header("Access-Control-Allow-Origin", "*");
        response.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE");
        response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Auth-Token");
        next();
    });

0 个答案:

没有答案