proxy server test in c# -
i making web request using proxy
httpwebrequest wr = (httpwebrequest)webrequest.create(inputurl); webproxy proxy = new webproxy(101.1.1.1,80); wr.headers.set(httprequestheader.acceptlanguage, "en-us"); wr.timeout = 100000; wr.method = "get"; wr.contenttype = "text/html;charset=utf-8";
when in fiddler, not see proxy information. how can create sure proxy beingness used correctly?
thanks
string proxyip = "61.135.178.114"; int proxyport = 80; var req = (httpwebrequest)httpwebrequest.create("http://ip-api.com/json"); req.proxy = new webproxy(proxyip, proxyport); var resp = req.getresponse(); var json = new streamreader(resp.getresponsestream()).readtoend(); var myip = (string)jobject.parse(json)["query"]; if (myip == proxyip) { messagebox.show("ok..."); }
you need json.net library run code
c# proxy
No comments:
Post a Comment