easypost-csharp icon indicating copy to clipboard operation
easypost-csharp copied to clipboard

POC: Add support for proxies

Open nwithan8 opened this issue 3 years ago • 0 comments

Description

  • Add support for using a proxy for HTTP traffic
    • Users can pass in a proxy configuration when initializing a client. Client will use this proxy when making HTTP calls.
  • Add unit test for proxy

Closes #102

Testing

  • Proxy unit test is skipped because the proxy used (via the [Private Internet Access] VPN company (https://helpdesk.privateinternetaccess.com/kb/articles/do-you-offer-a-socks5-proxy)) requires credentials
    • I have tested this locally with my personal PIA credentials to confirm it works.
    • The PIA proxy is a SOCKS5 proxy (as noted by the socks5 protocol). SOCKS5 proxies are only supported in .NET 6 and above. To test this as configured, you will need to run this in .NET 6.
    • I was unable to find a reliable and free HTTP proxy (.NET does not support HTTPS proxies currently). Those that weren't dead were throwing web server errors (which at least suggests that traffic was in fact being routed through them, meaning the proxy implementation works as expected).

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)

nwithan8 avatar Aug 17 '22 23:08 nwithan8