Created
November 8, 2010 09:14
-
-
Save mlangenberg/667515 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var sys = require('sys'), | |
| http = require('http'); | |
| var client = http.createClient(666, '127.0.0.1'); | |
| client.on('error', function() { | |
| sys.log('error during http request'); | |
| }) | |
| setInterval(function() { | |
| sys.log("trying http request"); | |
| var request = client.request('GET', '/'); | |
| request.end(); | |
| }, 1000); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[~/Desktop] $ node node-http-error.js
8 Nov 10:13:53 - trying http request
8 Nov 10:13:53 - error during http request
8 Nov 10:13:54 - trying http request
8 Nov 10:13:55 - trying http request
8 Nov 10:13:56 - trying http request
8 Nov 10:13:57 - trying http request
8 Nov 10:13:58 - trying http request