A HTML5/JavaScript multiplayer game experiment
BrowserQuest
I am trying to set up a BrowserQuest server that runs in openshift
I've been following this readme. Everything seems to go fine, I get to the end and run rhc app show bq
and get the following output:
bq @ http://bq-plantagenet.rhcloud.com/ (uuid: 55e4311189f5cf028d0000fc)
------------------------------------------------------------------------
Domain: plantagenet
Created: 8:18 AM
Gears: 1 (defaults to small)
Git URL: ssh://55e4311189f5cf028d0000fc@bq-plantagenet.rhcloud.com/~/git/bq.git/
SSH: 55e4311189f5cf028d0000fc@bq-plantagenet.rhcloud.com
Deployment: auto (on git push)
nodejs-0.10 (Node.js 0.10)
--------------------------
Gears: Located with smarterclayton-redis-2.6
smarterclayton-redis-2.6 (Redis)
--------------------------------
From: http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart
Website: https://github.com/smarterclayton/openshift-redis-cart
Gears: Located with nodejs-0.10
But when I try to access http://bq-plantagenet.rhcloud.com:8080/ in a browser, I get:
The connection has timed out
The server at bq-plantagenet.rhcloud.com is taking too long to respond
My questions are what is going wrong and how can I fix it? Many thanks for your consideration in reading through this and any suggestions you might have for resolving it
Source: (StackOverflow)
I am trying to get Mozilla's BrowserQuest up and running and have run into a problem. It depends on the websocket-server
node package, and unfortunately that has been deprecated and removed from the npm library.
I have added the ws
and node-websocket-server
packages, however neither of them seem to be an easy replacement for the existing calls to websocket-server
.
One prior SO post I saw said to replace websocket-server
with node-websocket-server
in the package.json
file, however there are existing direct calls to websocket-server
in the BrowserQuest codebase.
I also tried updating the server/js/ws.js
file directly as follows (added node- to the websocket-server fields):
var cls = require("./lib/class"),
url = require('url'),
wsserver = require("node-websocket-server"),
miksagoConnection = require('node-websocket-server/lib/ws/connection'),
worlizeRequest = require('websocket').request,
http = require('http'),
Utils = require('./utils'),
_ = require('underscore'),
BISON = require('bison'),
WS = {},
useBison = false;
which leads to the following error:
/homenode/browserquest/BrowserQuest/server/js/map.js:15
path.exists(filepath, function(exists) {
^
TypeError: undefined is not a function
at module.exports.cls.Class.extend.init (/home/node/browserquest/BrowserQuest/server/js/map.js:15:11)
at Class (/home/node/browserquest/BrowserQuest/server/js/lib/class.js:50:23)
at module.exports.cls.Class.extend.run (/home/node/browserquest/BrowserQuest/server/js/worldserver.js:151:20)
at /homenode/browserquest/BrowserQuest/server/js/main.js:79:15
at Function._.each._.forEach (/home/node/browserquest/BrowserQuest/node_modules/underscore/underscore.js:153:9)
at main (/home/node/browserquest/BrowserQuest/server/js/main.js:77:7)
at /home/node/browserquest/BrowserQuest/server/js/main.js:134:13
at /home/node/browserquest/BrowserQuest/server/js/main.js:117:13
at fs.js:334:14
at FSReqWrap.oncomplete (fs.js:95:15)
Source: (StackOverflow)