Duplicate question, sorry!

the answer is req.socket._handle:getpeername().ip

2015-02-28 8:34 GMT-03:00 Pablo Botelho <[email protected]>:

> Hello again folks,
>   I am inspecting the request object and can't find the remote ip.
>   Here is what's visible from the request object:
> {
>   _readableState = {
>     highWaterMark=16384,
>     needReadable=false,
>     ranOut=false,
>     buffer={},
>     length=0,
>     reading=false,
>     sync=true,
>     awaitDrain=0,
>     readingMore=false,
>     emittedReadable=false,
>     objectMode=false,
>     endEmitted=false,
>     readableListening=false,
>     ended=false,
>     pipesCount=0
>   },
>   method="GET",
>   url="/AAAAAAAAAAAAAA?asd=20",
>   httpVersion="1.1",
>   socket = {
>     _readableState = {
>       highWaterMark=16384,
>       needReadable=true,
>       ranOut=false,
>       endEmitted=false,
>       readingMore=false,
>       emittedReadable=false,
>       pipesCount=0,
>       objectMode=false,
>       buffer={},
>       reading=false,
>       sync=false,
>       awaitDrain=0,
>       flowing=true,
>       length=0,
>       readableListening=false,
>       ended=false,
>       resumeScheduled=false
>     },
>     _handle=uv_tcp_t: 0x4029df38,
>     allowHalfOpen=true,
>     handlers = {
>       data = {function: 0x414831a0},
>       _socketEnd = {function: 0x41c4e950},
>       end = {function: 0x407b5958, function: 0x4147e0d8},
>       finish = {function: 0x407b9728}},
>       _writableState = {
>         highWaterMark=16384,
>         prefinished=false,
>         length=0,
>         errorEmitted=false,
>         finished=false,
>         writelen=0,
>         objectMode=false,
>         ending=false,
>         ended=false,
>         needDrain=false,
>         sync=true,
>         corked=0,
>         writing=false,
>         pendingcb=0,
>         onwrite = function: 0x407b8cb8,
>         buffer={},
>         bufferProcessing=false
>       },
>       _connecting=false,
>       _destroyed=false,
>       _reading=true
>     },
>     headers = {host="0.0.0.0:8000
> ",accept="*/*",["user-agent"]="curl/7.35.0"}}
>
> Am I missing something?
>
> Thanks once again :)
>

-- 
You received this message because you are subscribed to the Google Groups 
"luvit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to