Socket.io-client: 400 (Bad Request)

Created on 21 May 2015  路  3Comments  路  Source: socketio/socket.io-client

Request:
GET http://localhost:3000/socket.io/?EIO=3&transport=polling&t=1432217406964-4

Response

{code: null}

Request console:

GET http://localhost:3000/socket.io/?EIO=3&transport=polling&t=1432217402391-3 400 (Bad Request)Request.create @ polling-xhr.js?533a:232Request @ polling-xhr.js?533a:155XHR.request @ polling-xhr.js?533a:86XHR.doPoll @ polling-xhr.js?533a:116Polling.poll @ polling.js?1450:118Polling.doOpen @ polling.js?1450:62Transport.open @ transport.js?e5ed:82Socket.open @ socket.js?5e31:220Socket @ socket.js?5e31:102Socket @ socket.js?5e31:37Manager.open.Manager.connect @ manager.js?0a19:205(anonymous function) @ manager.js?0a19:470
browser.js?1f0a:108 engine.io-client:socket socket error {"type":"TransportError","description":400} +14ms
debug.js?e9ea:35 socket.io-client:manager connect_error +13ms
debug.js?e9ea:35 socket.io-client:manager reconnect attempt error +0ms
debug.js?e9ea:35 socket.io-client:manager will wait 4549ms before reconnect attempt +1ms
browser.js?1f0a:108 engine.io-client:socket socket close with reason: "transport error" +1ms
browser.js?1f0a:108 engine.io-client:polling transport not open - deferring close +1ms
debug.js?e9ea:35 socket.io-client:manager attempting reconnect +4s
debug.js?e9ea:35 socket.io-client:manager readyState closed +0ms
debug.js?e9ea:35 socket.io-client:manager opening ws://localhost:3000/api +1ms
browser.js?1f0a:108 engine.io-client:socket creating transport "polling" +5s
browser.js?1f0a:108 engine.io-client:polling polling +1ms
browser.js?1f0a:108 engine.io-client:polling-xhr xhr poll +1ms
browser.js?1f0a:108 engine.io-client:polling-xhr xhr open GET: http://localhost:3000/socket.io/?EIO=3&transport=polling&t=1432217406964-4 +1ms
browser.js?1f0a:108 engine.io-client:polling-xhr xhr data null +1ms
browser.js?1f0a:108 engine.io-client:socket setting transport polling +2ms
debug.js?e9ea:35 socket.io-client:manager connect attempt will timeout after 20000 +8ms

Server console:

 engine intercepting request for path "/socket.io/" +5s
 engine handling "GET" http request "/socket.io/?EIO=3&transport=polling&t=1432217572991-36" +2ms
     password: 'password',
        database

Most helpful comment

The error was in this line of code, I just removed it

websocket.set("origins", "*")

All 3 comments

The error was in this line of code, I just removed it

websocket.set("origins", "*")

I am facing this two errors:-

First:-
polling-xhr.js:261 POST http://localhost:3001/socket.io/?EIO=3&transport=polling&t=NFXWAR3&sid=9OPaAXMDJAjr1IbbAAAg 400 (Bad Request)

Second:-
websocket.js:111 WebSocket connection to 'ws://localhost:3001/socket.io/?EIO=3&transport=websocket&sid=NlUSImfHeRNiKYf2AAAy' failed: Error during WebSocket handshake: Unexpected response code: 400

Was this page helpful?
0 / 5 - 0 ratings