好吧,忽略它。我已經打開了一個問題https://github.com/joyent/node/issues/793簡單的nodejs http代理失敗,「打開的文件太多」
試圖運行http://www.catonmat.net/http-proxy-in-nodejs
var http = require('http');
http.createServer(function(request, response) {
var proxy = http.createClient(80, request.headers['host'])
var proxy_request = proxy.request(request.method, request.url, request.headers);
proxy_request.addListener('response', function (proxy_response) {
proxy_response.addListener('data', function(chunk) {
response.write(chunk, 'binary');
});
proxy_response.addListener('end', function() {
response.end();
});
response.writeHead(proxy_response.statusCode, proxy_response.headers);
});
request.addListener('data', function(chunk) {
proxy_request.write(chunk, 'binary');
});
request.addListener('end', function() {
proxy_request.end();
});
}).listen(8080);
與請求數量巨大失敗後:
net.js:695
self.fd = socket(self.type);
^
Error: EMFILE, Too many open files
at net.js:695:19
at dns.js:171:30
at IOWatcher.callback (dns.js:53:15)
節點0.4.2在OSX 10.6
你使用的是什麼版本的節點,從1.3開始有很多補丁(我認爲這個錯誤開始) – RobertPitt 2011-03-16 10:36:11