Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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');
    });

....

}
share|improve this question

migrated from stackoverflow.com Jun 13 '12 at 7:13

This question came from our site for professional and enthusiast programmers.

1  
Show the code where you bind the socket. Maybe you bind to the wrong ip. –  ThiefMaster Jun 11 '12 at 14:05
    
Question updated –  ScaV Jun 11 '12 at 14:16
    
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 Jun 11 '12 at 14:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.