Estou tentando abrir a porta 843
no meu Cent OS 5.2, adicionei a seguinte linha a etc\sysconfig\iptables
:
-A INPUT -p tcp --dport 843 -j ACCEPT
e, em seguida, atualizei meu serviço iptables
. Eu preciso ouvir essa porta no meu aplicativo node.js que é executado pelo usuário root via sudo node index.js
comando, mas ainda recebo forbidden port
erro quando tento estabelecer uma conexão através dessa porta.
é isso que eu obtenho executando sudo iptables -L -v
:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
2811 238K ACCEPT tcp -- any any anywhere anywhere tcp dpt:http
112 6224 ACCEPT tcp -- any any anywhere anywhere tcp dpt:hbci
0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:843
41 2124 ACCEPT tcp -- any any anywhere anywhere state NEW tcp multiport dports 5901:5903,6001:6003
13093 13M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
26 3584 ACCEPT icmp -- any any anywhere anywhere
0 0 ACCEPT all -- lo any anywhere anywhere
109 6404 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
888K 80M REJECT all -- any any anywhere anywhere
e isso é superpou de sudo netstat -ptl | grep node
:
tcp 0 0 *:843 *:* LISTEN 12927/node
tcp 0 0 *:http *:* LISTEN 12927/node
tcp 0 0 *:10843 *:* LISTEN 12927/node
e eu tento escutar essa porta em socket.io com este código:
var io = require('socket.io').listen(
843,
{ log: false,
flashPolicyServer: true,
transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling']
}
);
io.sockets.on('connection', function(socket){
// my event listeners
});