need logger that gives us domain and city from site visitor

55 views
Skip to first unread message

john.tiger

unread,
Jun 30, 2012, 2:54:28 PM6/30/12
to nod...@googlegroups.com
sorry, maybe we asked this before but I can't find it

we're finding google analytics too much, too confusing to get simple
info we need so hoping we can just get this directly from our node
server. We really want visitors domain and city of origin, date/time -
that's really it.

we're using node-http-proxy, a mvc framework but no middleware (not
using express, flatiron). Either code snippet or a pre-packaged module
would be fine.

mscdex

unread,
Jun 30, 2012, 3:00:50 PM6/30/12
to nodejs
On Jun 30, 2:54 pm, "john.tiger" <john.tigernas...@gmail.com> wrote:
> we're finding google analytics too much, too confusing to get simple
> info we need so hoping we can just get this directly from our node
> server.  We really want visitors domain and city of origin, date/time -
> that's really it.

Try one of the geoip modules combined with whatever logging facilities
you need/want (e.g. console.log, database, etc).

john.tiger

unread,
Jul 1, 2012, 9:48:40 PM7/1/12
to nod...@googlegroups.com
okay, thanks, geoip gives all the geo info we need if we have the domain

now, how do we capture the incoming origin domain ? I just don't see
any info on this - would it be specific if we are using node-http-proxy
? thks for any help

Bradley Meck

unread,
Jul 2, 2012, 12:09:23 AM7/2/12
to nod...@googlegroups.com
IP address of request (will not traverse proxies)

req.connection.remoteAddress

Origin of IP if associated with DNS

dns.reverse

mscdex

unread,
Jul 2, 2012, 1:54:12 AM7/2/12
to nodejs
On Jul 1, 9:48 pm, "john.tiger" <john.tigernas...@gmail.com> wrote:
> okay, thanks, geoip gives all the geo info we need if we have the domain
>
> now, how do we capture the incoming origin domain ?  I just don't see
> any info on this - would it be specific if we are using node-http-proxy
> ?  thks for any help

For geoip you use IP addresses, not hostnames.

With node-http-proxy, you need to enable the xforward config option,
then you should be able to see the original IP address at the
forwarded site under the x-forwarded-for HTTP header.
Reply all
Reply to author
Forward
0 new messages