Last active
August 29, 2015 14:09
-
-
Save baslr/35ea7baaf906b9ff4157 to your computer and use it in GitHub Desktop.
test client for EADDRNOTAVAIL
This file contains 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
// Generated by CoffeeScript 1.8.0 | |
(function() { | |
var doReq, http, onRes; | |
http = require('http'); | |
doReq = function() { | |
return http.get({ | |
hostname: '127.0.0.1', | |
port: 60666, | |
path: '/', | |
headers: { | |
Connection: 'Keep-Alive' | |
} | |
}, onRes); | |
}; | |
onRes = function(res) { | |
var buf; | |
buf = new Buffer(0); | |
console.log(res.headers); | |
res.on('data', function(data) { | |
return buf = Buffer.concat([buf, data]); | |
}); | |
return res.on('end', doReq); | |
}; | |
doReq(); | |
}).call(this); |
This file contains 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
// Generated by CoffeeScript 1.8.0 | |
(function() { | |
var http, webServer; | |
http = require('http'); | |
webServer = http.createServer(); | |
webServer.listen(60666, '0.0.0.0'); | |
webServer.on('request', function(req, res) { | |
res.setHeader('connection', 'keep-alive'); | |
res.setHeader('Content-Type', 'Content-Type: text/plain; charset=utf-8'); | |
res.setHeader('content-length', 4); | |
return res.end('test'); | |
}); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
with
watch -n 1 "netstat -natp|grep ':60666'"
I getClient exits with