I am working on WPF application and need to test some server requests with a proxy. I can't find anyone for free with username and password. Does anyone have an idea or can give me a guide?

1 Answer 1


Use this code . this code helps you to enter username or password to credentials if the Http Proxy needs it :

string PROXY = ""; //TYPE OF PROXY : HTTP
string WEBSITE = "http://www.google.com";
string USERNAME = "";
string PASSOWRD = "";
bool CREDENTIALS; //if Proxy needs it
HttpWebRequest HTTP = (HttpWebRequest)HttpWebRequest.Create(WEBSITE);
HTTP.Proxy = new WebProxy(PROXY);
if (CREDENTIALS == true)
HTTP.Proxy.Credentials = new NetworkCredential(USERNAME, PASSOWRD);
HTTP.Proxy.Credentials = CredentialCache.DefaultCredentials;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.