Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy provider implementations #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ProphetLamb
Copy link

@ProphetLamb ProphetLamb commented Sep 17, 2023

Proxies are not always usable, and sometimes your target blocks the proxy we're using.
This PR abstracts the IProxyProvider interface behind a validation layer.

  1. Each IProxyProposalProvider produces a list of potential proxy server: API request here.
  2. Each IProxyProposalValidator validates the proxy server and returns: Good, Bad, or Idk.
  3. The ProxyProposalValidatorService BackgroundService periodically executes the validation of all sources. And always provides the latest list of validated proxies.
  • For each proposed WebProxy:
    • if no validation returns Bad
    • add to the list of validated proxies
    • otherwise; log and skip
  1. The ValidatedProxyProvider IProxyProvider integrates the system into the existing infrastructure. It simply returns the current list of the ProxyProposalValidatorService.

The PR adds dependencies to Microsoft.Extension.Hosting for the BackgroundService and Microsoft.Extensions.Configuration.Abstraction for the IOption<T> interface

ToDo

  • Add integration into the Service fluent builder.
  • Add ASP.NET integration
  • Add option to periodically restart puppeteer with the next proxy configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant