Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.request in examples code breaks node.js #26

Open
josephoster opened this issue Sep 16, 2012 · 0 comments
Open

client.request in examples code breaks node.js #26

josephoster opened this issue Sep 16, 2012 · 0 comments

Comments

@josephoster
Copy link

'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. (/home/joseph/node/load_test.js:15:4)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)

Changing 'client' to 'http' fixes the problem:

requestGenerator: function(http) {
return http.request('GET', "/" + Math.floor(Math.random()*8000), { 'host': 'localhost' });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant