wt-tracker icon indicating copy to clipboard operation
wt-tracker copied to clipboard

failed: Connection closed before receiving a handshake response

Open InvokerMaster opened this issue 4 years ago • 3 comments

Tracker websocket handshake always fails with this message. I can see the server is running and I can get 404 no response when visit the server url. Is this an issue or did I configure something wrong? Thank you

InvokerMaster avatar Jul 08 '20 18:07 InvokerMaster

Tracker works for me. Configuration file haven't changed.

mrlika avatar Jul 09 '20 10:07 mrlika

I get this error too! I run the server, i check stats.json to see if it works and everything works, but when I try to connect to server I get "Connection closed before receiving a handshake response" in the console and the server crashes with this error:

/home/pi/wt-tracker/dist/uws-tracker.js:67
                const origin = request.getHeader("origin");
                                       ^

TypeError: Cannot read property 'getHeader' of undefined
    at UWebSocketsTracker.onOpen (/home/pi/wt-tracker/dist/uws-tracker.js:67:40)

adelinn avatar Feb 15 '21 21:02 adelinn

I solved my issue by editing uws-tracker.js . I think I was using a newer version uWebSockets that deprecated "request" parameter in "onOpen" function so I had to replace onOpen in uws-tracker.js with onUpdate to make possible checking for AllowOrigin header. Note that onUpdate is called before onOpen.

adelinn avatar Feb 15 '21 23:02 adelinn

I solved my issue by editing uws-tracker.js . I think I was using a newer version uWebSockets that deprecated "request" parameter in "onOpen" function so I had to replace onOpen in uws-tracker.js with onUpdate to make possible checking for AllowOrigin header. Note that onUpdate is called before onOpen.

I did as you said this.onUpdate = (ws, request) => { but found that in stats.json it shows

webSocketsCount":-11102

fremzuck avatar Nov 28 '22 10:11 fremzuck

The latest uWebSockets.js and handling onUpdate is now in the latest version

DimaDemchenko avatar Feb 16 '24 07:02 DimaDemchenko