您好我正在使用来自节点js的meteor和http-proxy。我有时会遇到这个错误
W20160526-08:53:02.348(7)? (STDERR)
W20160526-08:53:02.350(7)? (STDERR) /usr/local/bin/here_test/node_modules/http-proxy/lib/http-proxy/index.js:119
W20160526-08:53:02.350(7)? (STDERR) throw err;
W20160526-08:53:02.426(7)? (STDERR) ^
W20160526-08:53:02.429(7)? (STDERR) Error: socket hang up
W20160526-08:53:02.429(7)? (STDERR) at createHangUpError (http.js:1528:15)
W20160526-08:53:02.430(7)? (STDERR) at Socket.socketCloseListener (http.js:1578:23)
W20160526-08:53:02.430(7)? (STDERR) at Socket.emit (events.js:95:17)
W20160526-08:53:02.430(7)? (STDERR) at TCP.close (net.js:466:12)
由于我没有从post得到任何答案,所以我在自己的帖子中提问。 这是我的代理代码
var PATH_TO_KEY = "/usr/local/bin/here_test/here.enseval.com.key",
PATH_TO_CERT = "/usr/local/bin/here_test/star_enseval_com(3).pem";
//PATH_TO_CHAIN = "";
var fs = require('fs'),
httpProxy = require('http-proxy');
var options = {
ssl: {
key: fs.readFileSync(PATH_TO_KEY, 'utf8'),
cert: fs.readFileSync(PATH_TO_CERT, 'utf8')
//ca : fs.readFileSync(PATH_TO_CHAIN, 'utf8')
},
target : "http://here.enseval.com",
secure:true,
ws:true,
xfwd: true
};
var server = httpProxy.createProxyServer(options).listen(443);
我已根据此website使用ws:true
,但我仍然得到了随机错误。
任何人都可以帮助我吗?
谢谢