简体   繁体   中英

Get App Names/Urls Requesting Rss Feed C#

I have a site that has an Rss feed, and this feed is consumed and redisplayed on a number of different sites.

Everytime the RSS feed is requested, I want to get the Url of the website requesting and re-displaying it. I have tried using 'Request.UrlReferrer' but this does not work?

I hope this makes sense, but to break it down.

Site A has the RSS feed

Site B reads in the RSS feed and does something with it

I want to catch the Url of Site B and store it in Site A somewhere so I can see what websites are using the RSS feed.

Is this possible?

You could use the Request.UserHostAddress property on site A to get the IP of the client sending the HTTP request.

Of course if you are running in a web farm and your web servers are behind a load balancer or a proxy this will give you the IP address of the load balancer and not the client. Hopefully your proxy server is configured to use the X-FORWARDED-FOR HTTP request header which ports the original client IP address. So if this is your case you could use Request.Headers["X-FORWARDED-FOR"] .

Depending on your requirements, yet another possibility is to simply exploit the IIS log files on Site A which contain all requests and their client IP addresses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM