Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit 542b0c6

Browse files
committed
Run project with node.js v0.6
- Removed require.paths.push() -> You need to set NODE_PATH env instead - Wrap connect app in http.server for socket.io to work (senchalabs/connect#500) - Renamed 'Index.html' to 'index.html' 7 tests passing / 2 fail (with xdebug 2.2)
1 parent 2d6939e commit 542b0c6

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

example/server.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ const XDEBUG_PORT = 9000,
4747
PHP_VHOST = "lib-phpdebug.localhost";
4848

4949
//TEMPORARY: http://stackoverflow.com/questions/5919629/express-module-not-found-when-installed-with-npm
50-
require.paths.push('/usr/local/lib/node_modules');
50+
//Set NODE_PATH in your environment instead (https://github.com/unconed/TermKit/issues/68)
51+
//require.paths.push('/usr/local/lib/node_modules');
5152

5253
var SYS = require("sys"),
5354
CLI = require("cli"),
5455
Q = require("q"),
5556
PATH = require("path"),
5657
QS = require("querystring"),
58+
HTTP = require('http'),
5759
CONNECT = require("connect"),
5860
CONNECT_DISPATCH = require("../support/dispatch"),
5961
SOCKET_IO = require("socket.io"),
@@ -129,6 +131,9 @@ function startServer(options)
129131
"/.*": CONNECT.static(__dirname + '/client', { maxAge: 0 })
130132
})
131133
);
134+
135+
// Wrap connect app in http.server for socket.io to work (https://github.com/senchalabs/connect/issues/500)
136+
var server = HTTP.createServer(app);
132137

133138
// If in test mode we stop when we are not pinged any more
134139
if (options.test)
@@ -141,7 +146,7 @@ function startServer(options)
141146
}, 800);
142147
}
143148

144-
var io = SOCKET_IO.listen(app);
149+
var io = SOCKET_IO.listen(server);
145150

146151
io.set("log level", 0);
147152
if (options.verbose)
@@ -230,7 +235,7 @@ function startServer(options)
230235
});
231236
});
232237

233-
app.listen(options.port);
238+
server.listen(options.port);
234239

235240
SYS.puts("Launched Xdebug proxy server on port " + options.port + "\n");
236241
}
File renamed without changes.

test/_helper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@
4444
*
4545
*/
4646
const PROXY_PORT = 9080, PHP_VHOST = "lib-phpdebug.localhost", XDEBUG_PORT = 9000, TEST_TIMEOUT = 5000;
47+
4748
//TEMPORARY: http://stackoverflow.com/questions/5919629/express-module-not-found-when-installed-with-npm
48-
require.paths.push('/usr/local/lib/node_modules');
49+
//Set NODE_PATH in your environment instead (https://github.com/unconed/TermKit/issues/68)
50+
//require.paths.push('/usr/local/lib/node_modules');
51+
4952
var CLI = require("cli"),
5053
Q = require("q"),
5154
HTTP = require("http"),

0 commit comments

Comments
 (0)