2017-04-19 189 views
0

我有2个不同的节点在Windows服务器上运行中间件(express)。无法连接到Windows Server 2008 R2上的节点

我已经运行了相当一段时间的第一个是在

http://judsondesigns.dyndns.org:3010/api/authenticate 

如果你做一个选择的小提琴手或邮递员打电话给这个API,你会得到头回来。

我只安装另一个实例(server.js),这是完全相同的代码只不同的端口:

http://judsondesigns.dyndns.org:3011/api/authenticate 

当我打这一个我得到ERR_CONNECTION_REFUSED。

我在防火墙上打开了端口3010和3011(TCP)。

我的文件是这样的:

app.set('port', process.env.PORT || 3011); 
// express/connect middleware 
app.use(morgan('dev')); 
router.use(function (req, res, next) { 
    res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate'); 
    res.header('Expires', '-1'); 
    res.header('Pragma', 'no-cache'); 
    next() 
}); 

app.listen(app.get('port'), function() { 
    console.log('myApp server listening on port ' + app.get('port')); 
}); 

enter image description here

回答

0

我想通了。必须在我的路由器上打开传入流量的端口。希望这有助于他人。

相关问题