2017-04-19 80 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

我想通了。必須在我的路由器上打開傳入流量的端口。希望這有助於他人。

相關問題