nodeload
nodeload copied to clipboard
client.request in examples code breaks node.js
'client.request()' is used in five of the /examples files and breaks the current nodeJS (v0.8.9). Example:
requestGenerator: function(client) { return client.request('GET', "/" + Math.floor(Math.random()*8000), { 'host': 'localhost' }); }
terminal output from simpletest.ex.js:
Test server on localhost:9000.
http.createClient is deprecated. Use http.request
instead.
Started HTTP server on localhost:8000.
events.js:66
throw arguments[1]; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:769:11)
at Server._listen2 (net.js:909:14)
at listen (net.js:936:10)
at Server.listen (net.js:985:5)
at Object.
Changing 'client' to 'http' fixes the problem:
requestGenerator: function(http) { return http.request('GET', "/" + Math.floor(Math.random()*8000), { 'host': 'localhost' }); }