Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 views
in Technique[技术] by (71.8m points)

javascript - Set up node so it is externally visible?

Newbie question - might be more appropriate for ServerFault, apologies if so.

I'm setting up node on Ubuntu 11.10, following the excellent howtonode instructions on installing Node.

I can get the Hello World page running on 127.0.0.1:8000, but how do I set it up to appear for my server's external IP?

I'm used to configuring Apache - what's the node equivalent of Apache's "Hello World" page?

Thanks for your help.

UPDATE: Maybe what I need is a tutorial on hosting Node. Would be great if anyone could suggest a good one.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is no configuration needed to make your external IP address work with node.js, unless and until you bind it otherwise.

Instead of .listen(PORT, IP_ADDRESS_OR_HOST ); use .listen(PORT);

Then, just use IP_ADDRESS_OR_HOST:PORT to access it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...