简体   繁体   English

从我的家用计算机发布Node.js / Grunt网站

[英]Publishing Node.js/Grunt website from my home machine

I have a site on node js and Grunt. 我在node js和Grunt上有一个站点。

Son when in my terminal I run "grunt serve:dist" it publishes me the site on 127.0.0.1:9000 儿子,当我在终端中运行“ grunt serve:dist”时,它将在127.0.0.1:9000上发布该网站

Now I want to publish this to the net, with no-ip.org 现在,我要使用no-ip.org将其发布到网上

Here's what I did: 这是我所做的:

  • Opened ports on my router: 在路由器上打开的端口:

    9000 9000 TCP/IP 192.0.1.11 9000 9000 TCP / IP 192.0.1.11

  • linking no-ip to my router 将无IP链接到我的路由器

  • disabling mac firewall 禁用Mac防火墙

but either I go on a browser and do xxx.xxx.xxx.xxx:9000 or mydomain.noip.me:9000 I don't see my website! 但要么我在浏览器上执行了xxx.xxx.xxx.xxx:9000或mydomain.noip.me:9000,但我没有看到我的网站!

Make sure when you call listen(port, ip) in your code that you specify "0.0.0.0" as the IP, meaning "all IP addresses". 确保在代码中调用listen(port, ip)时,将IP指定为"0.0.0.0" ,即“所有IP地址”。 If your code is listening bound to the 127.0.0.1 loopback IP address, it won't accept remote connections by definition. 如果您的代码正在侦听绑定到127.0.0.1环回IP地址,则根据定义,它将不接受远程连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM