{"id":19991311,"url":"https://github.com/msigut/FreeProxySharp","last_synced_at":"2025-05-04T10:31:24.892Z","repository":{"id":38011594,"uuid":"174287105","full_name":"msigut/FreeProxySharp","owner":"msigut","description":".NET Core Proxy library based on HttpClient works with FreeProxyList.net","archived":false,"fork":false,"pushed_at":"2022-12-08T05:26:52.000Z","size":60,"stargazers_count":19,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T13:07:48.659Z","etag":null,"topics":["free-proxy-list","httpclient","ihttpclientfactory","netstandard20","proxy"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msigut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-07T06:41:36.000Z","updated_at":"2024-02-24T10:12:32.000Z","dependencies_parsed_at":"2023-01-25T00:31:08.887Z","dependency_job_id":null,"html_url":"https://github.com/msigut/FreeProxySharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigut%2FFreeProxySharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigut%2FFreeProxySharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigut%2FFreeProxySharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msigut%2FFreeProxySharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msigut","download_url":"https://codeload.github.com/msigut/FreeProxySharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252320229,"owners_count":21729093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["free-proxy-list","httpclient","ihttpclientfactory","netstandard20","proxy"],"created_at":"2024-11-13T04:51:42.428Z","updated_at":"2025-05-04T10:31:20.637Z","avatar_url":"https://github.com/msigut.png","language":"C#","readme":"## FreeProxySharp\n\nHttpClient *(IHttpClientFactory)* + Proxy implementation with Dependency injection support and https://free-proxy-list.net/ as proxy-list source for .NET Standard 2.0 (netstandard2.0).\n\nLibrary **Checks**:\n- transparency (with reverse-IP check at: http://www.whatismyip.cz/)\n- HTTPS (with access to: http://www.google.com/)\n- measure **elapsed** time in miliseconds\n\nFor proxy **Parse** \u0026 **Check** use (test: [BasicTest.cs](/src/FreeProxySharp.Test/BasicTest.cs)):\n\n```c#\n// get proxy list\nvar proxies = await FreeProxyListNet.Parse();\n// check all proxies\nvar checkedProxies = await FreeProxyListNet.Check(proxies, codeFilter: new[] { \"DE\", \"PL\" },\n\trequired: 1, maxMiliseconds: 1200);\n```\n\nOr use it all together by **Dependency injection** init procedure (example at: [TestFixture.cs](/src/FreeProxySharp.Test/TestFixture.cs)).\n\n```c#\n// parse \u0026 check proxies ; save it into configuration\nOptions.CheckAndAssignToConfig(codeFilter: new[] { \"SE\", \"DE\", \"ES\", \"PL\" }, required: 2);\n\n// proxy client, with all proxies gets by CheckAndAssignToConfig\nservices.AddHttpClientProxy(\"PROXY\", Options);\n```\n\nAnd then use **build-in client** [HttpProxyClient.cs](/src/FreeProxySharp/HttpProxyClient.cs) (test: [BasicTest.cs](/src/FreeProxySharp.Test/BasicTest.cs))\n\n```c#\nvar factory = _test.Services.GetRequiredService\u003cHttpProxyFactory\u003e();\nvar client = factory.GetClientProxy(\"PROXY\");\nvar html = await client.GetStringSafeAsync(\"https://httpstat.us\");\n```\n\nFor common work with *IHttpClientFactory* clients, configure it by **Dependency injection** init procedure (example at: [TestFixture.cs](/src/FreeProxySharp.Test/TestFixture.cs)).\n\n```c#\n// common client, with all settings from Configuration\nservices.AddHttpClient(\"COMMON\", Options);\n// common client, with retry = 5\nservices.AddHttpClient(\"5RETRY\", retry: 5);\n// common client, with configured for retry when 404 status found (example)\nservices.AddHttpClient(\"404TEST\", Options, whenRetry: res =\u003e res.StatusCode == HttpStatusCode.NotFound);\n```\n\nConfiguration example [TestOptions.cs](/src/FreeProxySharp.Test/TestOptions.cs):\n\n```c#\npublic class TestOptions : IHttpProxyConfiguration\n{\n\tpublic int Retry =\u003e 2;\n        public int RetryFirstDelay =\u003e 1;\n        public bool GzipEnabled =\u003e true;\n        public string UserAgent =\u003e HttpExtensions.DEFAULT_AGENT;\n\t\n        public IHttpProxyServer[] Proxies { get; set; }\n}\n```\n\n### Update notice\n\nFor update from version 1.0.x -\u003e 1.1.x:\n\n- ADD: `AddHttpClient` and `AddHttpClientProxy` parameter `whenRetry` for `HttpClient` retry settings\n- ADD: `CheckAndAssignToConfig` switch: `throwWhenLessThanRequired` for exc. when less than requied proxy found\n- ADD: `CheckAndAssignToConfig` parameter: `Timeout` for timeout for checking all proxies\n- DEL: `IHttpProxyConfiguration.ProxyEnabled` removed (use `AddHttpClient` of `AddHttpClientProxy` instead manually)\n- DEL: `HttpProxyClient` removed ; now use `HttpExtensions` (for common configuration and tasks) \u0026 `HttpProxyFactory` (for work with proxy)\n\n","funding_links":[],"categories":["C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsigut%2FFreeProxySharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsigut%2FFreeProxySharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsigut%2FFreeProxySharp/lists"}