Sunday, 15 April 2012

c# - Inspect headers set by WebClient proxy -



c# - Inspect headers set by WebClient proxy -

i'm executing request through free proxy servers, , know headers each proxy server sets. right i'm visiting page prints out result in html body.

using(webclient client = new webclient()) { webproxy wp = new webproxy("proxy url"); client.proxy = wp; string str = client .downloadstring("http://www.pagethatprintsrequestheaders.com"); }

the webclient doesn't show modified headers, page prints right ones. there way find out headers beingness set proxy without visiting page prints them in example? have create own http listener?

it looks sending request webclient, through proxy , received host @ www.pagethatprintsrequestheaders.com.

if proxy adding headers request, webclient never see them on it's request.

webclient proxys request request headers added client -----------> proxy ----------------------> destination host

the webclient can see state of request between , proxy. proxy create new request send destination host, , request headers added. request received destination host (which why when echoes headers can see added proxy)

when response comes back, headers set host. it's possible proxy add together headers response, if did, not same headers adds request.

response response (forwarded proxy) (headers set host) client <------------------- proxy <------------------------- destination host

using host echo headers part of response payload 1 option. utilize between proxy , destination host inspect request there (e.g packet sniffer or proxy fiddler lets see request headers).

if proxy outside of network, getting between proxy , destination host hard (unless host under control).

c# asp.net

No comments:

Post a Comment