0
I have a Windows Server 2008 R2 Core x64 with node.js. Local adress of my machine is 192.168.1.40. Also i have a NAT, with translated 28966-28999 ports. My external adress is 212.232.xx.xx I have listened to 28969 port.
If i try to connect to my server by http://212.232.xx.xx:28969/ from my local network, then success. But i can't connect to http://212.232.xx.xx:28969/ outside from my network.
the same with 80 port.
I tried command netsh firewall add portopening tcp 28969 "Node.js"
, and nothing has changed.
Node.js script:
index.js:
var app = require('express').createServer();
app.listen(28969, '192.168.1.40');
var login = require('./login');
login.init(app);
login.js:
function init(app) {
var socks = require('socket.io');
....
var io = socks.listen(app);
io.of('/login').on('connection', socksEventsHandler);
....
app.get('/', function (req, res) {
res.redirect('/login');
});
app.get('/login', function (req, res) {
res.sendfile(__dirname + '/public/login.html');
});
app.get('/login.js', function (req, res) {
res.sendfile(__dirname + '/public/login.js');
});
app.get('/_login.js', function (req, res) {
res.sendfile(__dirname + '/public/_login.js');
});
....
}
1Show the code where you bind the socket. Maybe you bind to the wrong ip. – ThiefMaster – 2012-06-11T14:05:15.273
Question updated – ScaV – 2012-06-11T14:16:58.167
yeah, or wait for this one to be migrated (unless a moderator does it it needs a few people to cast close+migration votes) – ThiefMaster – 2012-06-11T14:45:10.010