@@ -59,7 +59,10 @@ TestRunner.prototype.assertProxied = function (host, proxyPort, port, createProx
59
59
60
60
var test = {
61
61
topic : function ( ) {
62
- var that = this , options = {
62
+ var that = this ,
63
+ options ;
64
+
65
+ options = {
63
66
method : 'GET' ,
64
67
uri : self . protocol + '://localhost:' + proxyPort ,
65
68
headers : {
@@ -172,9 +175,9 @@ TestRunner.prototype.webSocketTestWithTable = function (options) {
172
175
options . onListen ( socket ) ;
173
176
}
174
177
175
- self . startProxyServerWithTable (
176
- options . ports . proxy ,
177
- { router : options . router } ,
178
+ self . startProxyServerWithTable (
179
+ options . ports . proxy ,
180
+ { router : options . router } ,
178
181
function ( err , proxy ) {
179
182
if ( options . onServer ) { options . onServer ( proxy ) }
180
183
@@ -213,7 +216,10 @@ TestRunner.prototype.startProxyServer = function (port, targetPort, host, callba
213
216
//
214
217
TestRunner . prototype . startLatentProxyServer = function ( port , targetPort , host , latency , callback ) {
215
218
// Initialize the nodeProxy and start proxying the request
216
- var that = this , proxyServer = httpProxy . createServer ( function ( req , res , proxy ) {
219
+ var that = this ,
220
+ proxyServer ;
221
+
222
+ proxyServer = httpProxy . createServer ( function ( req , res , proxy ) {
217
223
var buffer = proxy . buffer ( req ) ;
218
224
219
225
setTimeout ( function ( ) {
@@ -235,7 +241,9 @@ TestRunner.prototype.startLatentProxyServer = function (port, targetPort, host,
235
241
// Creates the reverse proxy server with a ProxyTable
236
242
//
237
243
TestRunner . prototype . startProxyServerWithTable = function ( port , options , callback ) {
238
- var that = this , proxyServer = httpProxy . createServer ( merge ( { } , options , this . options ) ) ;
244
+ var that = this ,
245
+ proxyServer = httpProxy . createServer ( merge ( { } , options , this . options ) ) ;
246
+
239
247
proxyServer . listen ( port , function ( ) {
240
248
that . testServers . push ( proxyServer ) ;
241
249
callback ( ) ;
@@ -248,10 +256,12 @@ TestRunner.prototype.startProxyServerWithTable = function (port, options, callba
248
256
// Creates a latent reverse proxy server using a ProxyTable
249
257
//
250
258
TestRunner . prototype . startProxyServerWithTableAndLatency = function ( port , latency , options , callback ) {
259
+ //
251
260
// Initialize the nodeProxy and start proxying the request
252
- var proxyServer ,
253
- that = this ,
254
- proxy = new httpProxy . HttpProxy ( merge ( { } , options , that . options ) ) ;
261
+ //
262
+ var that = this ,
263
+ proxy = new httpProxy . HttpProxy ( merge ( { } , options , that . options ) ) ,
264
+ proxyServer ;
255
265
256
266
var handler = function ( req , res ) {
257
267
var buffer = proxy . buffer ( req ) ;
@@ -263,8 +273,8 @@ TestRunner.prototype.startProxyServerWithTableAndLatency = function (port, laten
263
273
} ;
264
274
265
275
proxyServer = that . options . https
266
- ? https . createServer ( that . options . https , handler , that . options )
267
- : http . createServer ( handler , that . options ) ;
276
+ ? https . createServer ( that . options . https , handler , that . options )
277
+ : http . createServer ( handler , that . options ) ;
268
278
269
279
proxyServer . listen ( port , function ( ) {
270
280
that . testServers . push ( proxyServer ) ;
@@ -278,7 +288,9 @@ TestRunner.prototype.startProxyServerWithTableAndLatency = function (port, laten
278
288
// Creates proxy server forwarding to the specified options
279
289
//
280
290
TestRunner . prototype . startProxyServerWithForwarding = function ( port , targetPort , host , options , callback ) {
281
- var that = this , proxyServer = httpProxy . createServer ( targetPort , host , merge ( { } , options , this . options ) ) ;
291
+ var that = this ,
292
+ proxyServer = httpProxy . createServer ( targetPort , host , merge ( { } , options , this . options ) ) ;
293
+
282
294
proxyServer . listen ( port , function ( ) {
283
295
that . testServers . push ( proxyServer ) ;
284
296
callback ( null , proxyServer ) ;
@@ -289,7 +301,11 @@ TestRunner.prototype.startProxyServerWithForwarding = function (port, targetPort
289
301
// Creates the 'hellonode' server
290
302
//
291
303
TestRunner . prototype . startTargetServer = function ( port , output , callback ) {
292
- var that = this , targetServer , handler = function ( req , res ) {
304
+ var that = this ,
305
+ targetServer ,
306
+ handler ;
307
+
308
+ handler = function ( req , res ) {
293
309
res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
294
310
res . write ( output ) ;
295
311
res . end ( ) ;
0 commit comments