OgarProject / Ogar

An open source Agar.io server implementation, written with Node.js.
Other
719 stars 821 forks source link

> TypeError: Cannot read property 'headers' of undefined #703

Open universebound opened 7 years ago

universebound commented 7 years ago

[Game] Ogar - An open source Agar.io server implementation [Game] Loaded 0 plugin(s) [Game] Listening on port 281 [Game] Current game mode is Free For All [Game] Loaded stats server on port 88

TypeError: Cannot read property 'headers' of undefined at GameServer.connectionEstablished (C:\Users\Hp\Downloads\Ogar-master\Ogar-master\src\GameServer.js:219:35) at emitTwo (events.js:125:13) at WebSocketServer.emit (events.js:213:7) at handleUpgrade (C:\Users\Hp\Downloads\Ogar-master\Ogar-master\node_modules\ws\lib\WebSocketServer.js:88:16) at WebSocketServer.completeUpgrade (C:\Users\Hp\Downloads\Ogar-master\Ogar-master\node_modules\ws\lib\WebSocketServer.js:270:5) at WebSocketServer.handleUpgrade (C:\Users\Hp\Downloads\Ogar-master\Ogar-master\node_modules\ws\lib\WebSocketServer.js:197:10) at Server.WebSocketServer._ultron.on (C:\Users\Hp\Downloads\Ogar-master\Ogar-master\node_modules\ws\lib\WebSocketServer.js:87:14) at emitThree (events.js:135:13) at Server.emit (events.js:216:7) at onParserExecuteCommon (_http_server.js:494:14)

ialexsip commented 7 years ago

comment ( // ) from line 219 to 229.

ghost commented 7 years ago

If you read the comments above the code that is giving errors, it says that if you try to disable to certain code legal action may be taken against you. I'm still trying to fix this bug by replacing the line: var origin = ws.UpgradeReq.headers.origin to the actual origin varible in the object of ws. This just boils down to that UpgradeReq is deprecated or removed.

ChikoxD commented 7 years ago

I have the same problem. any solution?