sockjs / sockjs-node

WebSocket emulation - Node.js server
http://sockjs.org
MIT License
2.09k stars 309 forks source link

How can I debug a 400 http status code? #241

Closed simasch closed 6 years ago

simasch commented 6 years ago

Hi,

I'm trying the echo example behind a web application firewall and see these requests:

info : GET /echo/info?t=1531127642858 0ms 200 info : GET /echo/078/ilarcpb2/websocket 0ms 400 info : POST /echo/078/o4yujssu/xhr_streaming?t=1531127643159 1ms (unfinished)

How can I debug the 400 error to see what the problem is?

Thanks, Simon

brycekahle commented 6 years ago

You need to inspect the HTTP response. The most likely reason is an invalid websocket request from this code: https://github.com/sockjs/sockjs-node/blob/14a5c3cf097126bde74436d001816c53a0593d43/src/trans-websocket.coffee#L17