lsof -i:8080

result:

node    32419 root    6u  IPv4 122865       TCP localhost.localdomain:webcache (LISTEN)

the result is different from

lsof -i:80

result:

nginx   32029  root    6u  IPv4 121546       TCP *:http (LISTEN)
nginx   32030 nginx    6u  IPv4 121546       TCP *:http (LISTEN)

nginx is : "TCP *", but node's process "localhost.localdomain". what does it mean, localhost.localdomain? it means the process can access from localhost only?

I have a troble to access node process from another server via 8080 port.

any comments plz~

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

in the first case nginx listens only on the loopback interface; 127.0.0.1 is resolved to localhost.localdomain thru /etc/hosts in the second case nginx listens on all the available interfaces (notice *:http)

so the answer is yes, it can be accessed from the local host only;

you can add "-n" flag to lsof to see ip addresses instead of the names those may be resolved to.

link|improve this answer
so can I change node's process into TCP:* like nginx? – augustin Mar 28 '11 at 10:22
yes you can, you have to configure "node" to listen on all available interfaces if this is what you want. so i'm not sure what "node" is. if "node" does not support listener configuration then you can do some tricks from either iptables or ipfw/pf (not sure what your OS is) to redirect the traffic destined for node to localhost – malfaux Mar 28 '11 at 10:28
node is nodejs Hello World, example code. nodejs.org , nothing special configuration, just simple 6 line code. hm... so you mean I have find out the solution in node module~ – augustin Mar 28 '11 at 10:35
snip: this piece of code: isten(8124, "127.0.0.1"); put "0.0.0.0" instead of "127.0.0.1" – malfaux Mar 28 '11 at 10:37
1  
127.0.0.0/8 is defined by iana to be used for local purposes only. this class will never be routed outside your router (well unless you force it to ;) ) nor the router will accept requests coming to this address. putting it simple, you can't access that ip address from outside your host. "0.0.0.0" means "listen to all the available interfaces on this host" – malfaux Mar 28 '11 at 10:51
show 1 more comment
feedback

Port 8080 is just listening locally (on localhost).

Port 80 (shown as http) is listening on ALL bound IP addresses on port 80.

link|improve this answer
For clarity: you're relatively safe with port 8080 being bound to localhost so there's nothing to worry about. HTH, JR – Jonathan Ross Mar 28 '11 at 10:07
jonathan, but I have to connect node's module from another server. but, I can't. That's the real problem~ -_-; – augustin Mar 28 '11 at 10:23
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.