无法从Amazon Windows实例的公共IP访问Node.js服务器 [英] not able to access node.js server from public ip of amazon windows instance

查看:77
本文介绍了无法从Amazon Windows实例的公共IP访问Node.js服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows服务器的亚马逊微实例上运行node.js服务器.我无法使用Amazon实例的公共IP访问node.js服务器.我可以使用localhost:12345从实例访问node.js服务器,但不能使用实例的公共ip从其他PC访问(54.200.211.174)54.200.211.174:12345这是我的node.js代码....

i am running a node.js server on my amazon micro instance of windows server. i am not able to access the node.js server using the public ip of amazon instance. I can access the node.js server from the instance using localhost:12345 but not able to access from other pc's using the public ip of the instance(54.200.211.174) 54.200.211.174:12345 here is my node.js code.....

var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(12345);

console.log('Server running on port 12345.');

我还为此端口添加了安全规则类型协议端口范围源自定义TCP规则TCP 12345 0.0.0.0/0

i also added the security rule for this port Type Protocol Port Range Source Custom TCP rule TCP 12345 0.0.0.0/0

请帮助我使用亚马逊实例的公共IP访问我的node..js服务器

Please help me to access my node..js server using public ip of amazon instance

推荐答案

解决方案: 允许从所需端口进入计算机的传入流量

Solution: Allow incoming traffic to your machine on required port

Windows防火墙阻止传入到您计算机的流量.您可以按照以下步骤添加入站规则":

Windows firewall blocking incoming traffic to your machine. you can follow below steps to add 'Inbound Rules':

  1. 打开"Windows防火墙"(在开始"菜单中搜索)
  2. 在左窗格中单击高级设置"
  3. 选择入站规则"
  4. 在右窗格中单击新规则..."
  5. 选择端口",然后单击下一步"
  6. 选择所需的"TCP"或"UDP"并输入端口号(在您的情况下,端口为12345 )
  7. 选择允许连接",然后单击下一步"
  8. 选择需要应用规则的位置.
  9. 提供规则的名称和描述,然后单击完成

您的问题一定会得到解决!

Your issue will definitely get resolved!

这篇关于无法从Amazon Windows实例的公共IP访问Node.js服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆