编辑:解决了…有一个硬件防火墙的方式!
我在远程Debian GNU / Linux 6.0.4(squeeze)服务器上安装了node.js,并在端口8866上运行了这个http服务器。
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); console.log('Someone set up us the bomb'); }).listen(8866, "0.0.0.0"); console.log('Server running at http://0.0.0.0:8866/');
它似乎运行:
node server.js root@pod:/var/www# Server running at http://0.0.0.0:8866/
但是当我去http://213.159.xxx.xxx:8866没有显示,它超时。 所以我想也许我的端口被阻塞,所以我开始摆弄iptables,nmap等…但它仍然没有运行。 我会告诉你一些重要的输出,也许你们可以告诉我去一个有效的服务器的方式,我想我会接近。
以下是服务器上iptables -L的结果:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:8866 fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh ACCEPT tcp -- anywhere anywhere tcp dpt:http-alt ACCEPT tcp -- anywhere anywhere tcp dpt:8866 Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:8866 ACCEPT tcp -- anywhere anywhere tcp dpt:8866 Chain fail2ban-ssh (1 references) target prot opt source destination RETURN all -- anywhere anywhere
而nmap 213.159.xx.xxx -p 8866 -A
Starting Nmap 5.00 ( http://nmap.org ) at 2012-05-17 16:08 CEST Someone set up us the bomb Someone set up us the bomb Someone set up us the bomb Someone set up us the bomb Interesting ports on pod (213.159.xx.xxx): PORT STATE SERVICE VERSION 8866/tcp open unknown
我也加了netstat:
# netstat -pan | grep 88 tcp 0 0 0.0.0.0:8866 0.0.0.0:* LISTEN 12468/node
这里的帽子出问题了? 端口是closures的,他们只接受本地域名还是有tcp / http问题?
克。
从OP:
解决…有一个硬件防火墙的方式!
在你的服务器上看起来不错。
你需要开始本地和倒退。 它从本地主机工作? 从本地机器直接针对IP? 另一台机器在同一个networking上? 一跳?
我们不知道你的客户端和服务器之间有什么问题 – 有些设备是可能的,你只需要find它。
我认为“spt”会在OUTPUT链中更好地工作;)