We set the port to whatever we want, but it's a common security and usage practice to not use "low ports" (lower then 1024) for app servers. In fact, in most operating systems, if you run the app server as a non-system user, you _cannot_ bind to such port.
The usual practice for Node.js (or, say, Tomcat, or Websphere or RoR or any other app servers) to be bound to some high port (above 1024) and then let nginx, apache, IIS or something else serve the port 80, and proxy over requests to the app server. That way on one host you can even run multiple app servers with one web server. Nothing would stop you to run as, say, root on Linux or a Mac, and bind the Node.js app to port 80, but then your app has root privileges, and if your code (or some of the modules you use) is buggy or has security problems, your app would be a risk to the whole system. Zlatko On Saturday, June 20, 2015 at 3:43:51 AM UTC+2, Ray Jender wrote: > > > So, for all of the example and demo code I have seen, they always include > doing "node file.js" and then it echos back "Listening at: > http://localhost:8080" or similar. > Which implies I have to browse to port 8080 to use the app. > > My question is how does this work in production? I have never had to > browse to a website using a port number? I'm confused? > How can I simply browse to a URL and not include a port number? > > Thanks, > > Ray > > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/b84f439d-90ab-4115-b169-6538d941cd2d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.