 
   server.listen 0
   server.on 'listening', ->
-    http.cat "http://127.0.0.1:#{server.address().port}/", "utf8", (err, data) ->
-      test.ok err
+    req = http.request host: '127.0.0.1', port: server.address().port, (res) ->
+      test.same 500, res.statusCode
       server.close()
+    req.end()
 
 exports.testProxyCookies = (test) ->
   test.expect 2


  server.listen 0
  server.on 'listening', ->
    http.cat "http://127.0.0.1:#{server.address().port}/", "utf8", (err, data) ->
      test.ok !err
      server.close()

exports.testProxyRequestWithClientException = (test) ->
  test.expect 3


  server.listen 0
  server.on 'listening', ->
    req = http.request host: '127.0.0.1', port: server.address().port, (res) ->
      test.same 500, res.statusCode
      server.close()
    req.end()

exports.testProxyRequestWithErrorCreatingProcess = (test) ->
  test.expect 3
