as far as i know if you want to get the specific ip address of an
interface then you will have to bind explicitly to that IP address and
not to "0.0.0.0" in order to get the correct IP from getsockname,
which is the system call used under the hood. so, instead of doing:

server.listen(80) or server.listen(80, "0.0.0.0")

you need to do:

server.listen(80, "10.11.12.100")

replacing 10.11.12.100 with the IP address you want to listen on.

http://stackoverflow.com/questions/5759031/getsockname-always-returning-0-0-0-0

On Feb 27, 9:05 pm, mscdex <[email protected]> wrote:
> On Feb 27, 3:46 pm, Tim Whidden <[email protected]> wrote:
>
> > Hi mscdex,
>
> > Unfortunately in my testing that always returns 0.0.0.0.
>
> Ok, how about: req.connection.address() ?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to