How do I get a http client ip

29 views
Skip to first unread message

xx 宋

unread,
Aug 18, 2014, 6:01:04 AM8/18/14
to tot...@googlegroups.com
HI peter

now, i need write log to file 

the log content require the ip of client ,is http ,not websocket 

but ,i don't know how to get the ip of http request client 

tks 

Peter Širka

unread,
Aug 18, 2014, 6:13:24 AM8/18/14
to tot...@googlegroups.com
Hi xx,

controller.ip

function some_action() {
   
var self = this;
    console
.log(self.ip, self.req.ip);
   
self.plain('RESPONSE');
}

Thanks!

xx 宋

unread,
Aug 18, 2014, 10:09:44 PM8/18/14
to tot...@googlegroups.com
thank you .


在 2014年8月18日星期一UTC+8下午6时01分04秒,xx 宋写道:
Reply all
Reply to author
Forward
0 new messages