richardg867 / WaybackProxy

HTTP proxy for tunneling requests through the Internet Archive Wayback Machine
GNU General Public License v3.0
667 stars 56 forks source link

Add pass-through whitelisting support #15

Closed nfinit closed 1 year ago

nfinit commented 1 year ago

There are many sites out there that are still useful or even targeted to legacy systems and browsers nowadays, and to better integrate them with the proxy in my usage I have added a simple whitelisting system that bypasses proxying for any domains listed in a file called whitelist.txt in the same directory as the main script. With this, you can now use the proxy while also still being able to access new or still-extant sites that run well on your system, like FrogFind or Floodgap that are both provided as examples in the default whitelist.

All changes are implemented in the Handler class:

One caveat to this current implementation is that it does not pass through to subdomains, so separate lines on the file will be needed for domain.com and www.domain.com as examples. Reading in the file with every request does not appear to have any meaningful performance impact in my testing and allows for on-demand updates without restarting the proxy.

Thank you for your time, and please let me know if you have any questions or ideas to improve these changes.

nfinit commented 1 year ago

Closed this PR to move the whitelisting functionality to a new branch so it won't capture other changes