@@ -41,13 +41,14 @@ const XDEBUG_PORT = 9000,
4141//Set NODE_PATH in your environment instead (https://github.com/unconed/TermKit/issues/68)
4242//require.paths.push('/usr/local/lib/node_modules');
4343
44- var SYS = require ( "sys " ) ,
44+ var CONSOLE = require ( "console " ) ,
4545 CLI = require ( "cli" ) ,
4646 Q = require ( "q" ) ,
4747 PATH = require ( "path" ) ,
4848 QS = require ( "querystring" ) ,
4949 HTTP = require ( 'http' ) ,
5050 CONNECT = require ( "connect" ) ,
51+ SERVE_STATIC = require ( 'serve-static' ) ,
5152 CONNECT_DISPATCH = require ( "dispatch" ) ,
5253 SOCKET_IO = require ( "socket.io" ) ,
5354 XDEBUG = require ( "../lib/xdebug" ) ,
@@ -81,9 +82,9 @@ CLI.main(function(args, options)
8182
8283function startServer ( options )
8384{
84- var lastPing = false ;
85+ var lastPing = false ;
8586
86- var app = CONNECT . createServer (
87+ var server = HTTP . createServer (
8788
8889 CONNECT_DISPATCH ( {
8990
@@ -119,12 +120,12 @@ function startServer(options)
119120 }
120121 } ,
121122
122- "/.*" : CONNECT . static ( __dirname + '/client' , { maxAge : 0 } )
123+ "/.*" : SERVE_STATIC ( __dirname + '/client' , { maxAge : 0 } )
123124 } )
124125 ) ;
125126
126127 // Wrap connect app in http.server for socket.io to work (https://github.com/senchalabs/connect/issues/500)
127- var server = HTTP . createServer ( app ) ;
128+ // var server = HTTP.createServer(app);
128129
129130 // If in test mode we stop when we are not pinged any more
130131 if ( options . test )
@@ -139,12 +140,6 @@ function startServer(options)
139140
140141 var io = SOCKET_IO . listen ( server ) ;
141142
142- io . set ( "log level" , 0 ) ;
143- if ( options . verbose )
144- io . set ( "log level" , 2 ) ;
145- if ( options . debug )
146- io . set ( "log level" , 3 ) ;
147-
148143 // Initialize and hook in the debug proxy server so it can
149144 // communicate via `socket.io`.
150145
@@ -218,7 +213,7 @@ function startServer(options)
218213 var command = "node " + PATH . normalize ( __dirname + "/../test/all --port " + options . port + " --php " + options . php ) ;
219214 EXEC ( command , function ( error , stdout , stderr )
220215 {
221- SYS . puts ( "[proxyServer] " + stdout . split ( "\n" ) . join ( "\n[proxyServer] " ) + "\n" ) ;
216+ CONSOLE . log ( "[proxyServer] " + stdout . split ( "\n" ) . join ( "\n[proxyServer] " ) + "\n" ) ;
222217 } ) ;
223218 } ) ;
224219 socket . emit ( "init" , {
@@ -228,7 +223,7 @@ function startServer(options)
228223
229224 server . listen ( options . port ) ;
230225
231- SYS . puts ( "Launched Xdebug proxy server on port " + options . port + "\n" ) ;
226+ CONSOLE . log ( "Launched Xdebug proxy server on port " + options . port + "\n" ) ;
232227}
233228
234229function runBrowserTest ( test , timeout )
0 commit comments