wt-tracker
wt-tracker copied to clipboard
failed: Connection closed before receiving a handshake response
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
Tracker works for me. Configuration file haven't changed.
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)
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 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
The latest uWebSockets.js and handling onUpdate is now in the latest version