Is there a way get the "real" request

53 views
Skip to first unread message

Steven Yue

unread,
Nov 21, 2014, 2:30:05 PM11/21/14
to gopro...@googlegroups.com
Hi,

I'm using code like this: https://gist.github.com/steventen/e9a4fb3380e4ca4002e8  to log the request link and client ip kind of information.

But if the user visits a website (say "golang.com") through a browser. The proxy will log a lot more requests besides "http://golang.com", for example: "http://www.google-analytics.com/", "http://clients1.google.com/ocsp", ...

Is there a way that I can obtain only the user's actual request url ("http://golang.com" in this case ), or distinguish other information from the user's real target?



Thanks

Elazar Leibovich

unread,
Nov 22, 2014, 11:05:34 AM11/22/14
to Steven Yue, gopro...@googlegroups.com
Hmmm... I'm not an expert on this topic, but I'm not sure the browser indicates whether or not the request was a "real" request.

Moreover, what is a real request is not well defined. What about user clicking a button and JS issuing a request, is that considered "real"?

What I would do is, use timing, all request that comes in the range of, say, 2 seconds are considered the same.

--
You received this message because you are subscribed to the Google Groups "goproxy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goproxy-dev...@googlegroups.com.
To post to this group, send email to gopro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/goproxy-dev/caabea8e-4e55-47c6-ae04-7ad3c7b3c69c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Yue

unread,
Nov 23, 2014, 4:34:27 PM11/23/14
to gopro...@googlegroups.com, jinc...@gmail.com
Hi, Elazar

Thanks for your reply. 

Yeah, you are right about this "real" request thing. I like your idea that considers they are the same if in a certain time range.

Matthew Zimmerman

unread,
Nov 23, 2014, 9:00:51 PM11/23/14
to Steven Yue, gopro...@googlegroups.com

The referrer header will have the "real" site listed, of course it can also be just the source of the link from whence they came.
http://en.m.wikipedia.org/wiki/HTTP_referer

This is not an exact science

Reply all
Reply to author
Forward
0 new messages