🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# RMOS / httpclient request proxy ayarlaması httpwebclient

1-) C# RMOS - httpclient request proxy ayarlaması

 

kaynak : https://stackoverflow.com/questions/29856543/httpclient-and-using-proxy-constantly-getting-407

 

string link = @"https://www.bulurum.com/advdetails/dc26_d17_0db6j0i402c4gada35e_e62";

 

        private void button1_Click(object sender, EventArgs e)

        {

             ServicePointManager.Expect100Continue = true;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            CookieContainer cookies = new CookieContainer();

            HttpClientHandler handler = new HttpClientHandler();

            handler.CookieContainer = cookies;

 

            string proxyHost = "222.254.239.53", proxyPort="80", proxyUserName= "asd@gmail.com", proxyPassword= "aaa";

            var proxy = new WebProxy

            {

                Address = new Uri($"http://{proxyHost}:{proxyPort}"),

                BypassProxyOnLocal = false,

                UseDefaultCredentials = false,

 

                // *** These creds are given to the proxy server, not the web server ***

                Credentials = new NetworkCredential(

        userName: proxyUserName,

        password: proxyPassword)

            };

 

            var httpClientHandler = new HttpClientHandler

            {

                Proxy = proxy,

            };

 

          

             client = new HttpClient(handler: httpClientHandler, disposeHandler: true);

 

            client.DefaultRequestHeaders.Add("User-Agent", "PostmanRuntime/7.29.2");

        }

 

 

2-) free proxy ler

 

 

https://hidemy.name/en/proxy-list/?__cf_chl_jschl_tk__=28bab69cfc2e76ba50c0d9b43500016d18971f64-1592378093-0-AVet-UfsSh3vNuPdGOsxOf1QMurjfSlwkYG2uc-mLhNQkqJ4VRi281N7Mh_g6jVHJpJbcq0hC1D5BM6adUMvGYt8J4qcf8vkCxRZNr7MeYdePzvwC8wxBd7FpiivA63We1x_oDFvrTCB5WDVmgAXXHLZJsmQIDr7gmKskFqChTFraewoTFbq-wTWuxDwmE97DFEtS3zURF7kA3eZOOGztRi40qJTc0W3kCV4QSDKeaCqXto9QU9v8ZjbhLCGabHktr451qxgBvHVOHw3Qe3u-3YbZjm1IBgEtEm3wR41HFs0

 

 

 2023 Ocak 23 Pazartesi
 682