MultiOgar icon indicating copy to clipboard operation
MultiOgar copied to clipboard

Cannot read property 'headers' of undefined

Open Altar82 opened this issue 7 years ago • 8 comments

hi, I installed multi-ogar as described in the guide, but at the start I get this error can someone help me?

[INFO ][16:55:42] [1m[32mMultiOgar 1.2.69[37m - An open source multi-protocol ogar server[0m [INFO ][16:55:42] 0 IP ban records loaded. [WARN ][16:55:42] User account "Local Administrator" disabled [WARN ][16:55:42] User account "Local Moderator" disabled [WARN ][16:55:42] User account "Local User" disabled [INFO ][16:55:42] 0 user records loaded. [INFO ][16:55:42] 25 bad words loaded [WARN ][16:55:42] TLS: not supported (SSL certificate not found!) [INFO ][16:55:42] WebSocket: ws [INFO ][16:55:42] Started stats server on port 1500 [INFO ][16:55:42] Listening on port 1501 [INFO ][16:55:42] Current game mode is Free For All [FATAL][16:56:01] TypeError: Cannot read property 'headers' of undefined at GameServer.onClientSocketOpen (/root/MultiOgar/src/GameServer.js:273:107) at emitTwo (events.js:106:13) at WebSocketServer.emit (events.js:191:7) at handleUpgrade (/root/MultiOgar/node_modules/ws/lib/websocket-server.js:89:16) at WebSocketServer.completeUpgrade (/root/MultiOgar/node_modules/ws/lib/websocket-server.js:282:5) at WebSocketServer.handleUpgrade (/root/MultiOgar/node_modules/ws/lib/websocket-server.js:221:10) at Server.WebSocketServer._ultron.on (/root/MultiOgar/node_modules/ws/lib/websocket-server.js:88:14) at emitThree (events.js:116:13) at Server.emit (events.js:194:7) at onParserExecuteCommon (_http_server.js:409:14) [DEBUG][16:56:01] process.exit(1)

Ty so much

Altar82 avatar Jan 30 '18 22:01 Altar82

Ty so much

Altar82 avatar Feb 02 '18 18:02 Altar82

@Altar82 close!!

SAV-404 avatar Feb 03 '18 21:02 SAV-404

upgradeReq.header ==> req.headers

Petabyte918 avatar Sep 01 '18 15:09 Petabyte918

The comment @ItzLevvie mentioned isn't valid anymore as most of the code doesnt exist in this fork. I tried the suggestion @Petabyte918 brought up and it didn't work either. Is there a fix for this issue?

teddyh-io avatar Nov 03 '19 23:11 teddyh-io

Still getting this issue. @Petabyte918's solution didnt help

ZandercraftGames avatar May 22 '20 22:05 ZandercraftGames

Here is an issue someone made about "upgradeReq" not being defined. https://github.com/websockets/ws/issues/1114

FlushDesert22 avatar Jun 14 '20 00:06 FlushDesert22

Anyone got a solution?

Vampucha avatar Sep 21 '20 14:09 Vampucha

I've got a solution to this open MultiOgar-master\src\GameServer.js and put this in the line 273: Logger.write("CONNECTED " + ws.remoteAddress + ":" + ws.remotePort + ", origin: "" + ((ws.upgradeReq && ws.upgradeReq.headers) ? ws.upgradeReq.headers.origin : "N/A") + """);

itraw avatar Dec 28 '23 11:12 itraw