Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks.
Many people want to integrate Privoxy into their own projects, I made some changes to the Privoxy codes to compiled into a DLL or static library, so that you can better integrate it into their own projects.
Base on work from:
Privoxy: https://www.privoxy.org/ (based on its latest version 3.0.28)
LibPrivoxy: https://github.com/tarolabs/LibPrivoxy
DNS query: https://www.binarytides.com/dns-query-code-in-c-with-winsock/
Develop environment: Visual Studio 2017
License: GNU GENERAL PUBLIC LICENSE Version 2
Author: Shiyu Tang <shiyutang#gmail.com>
Notice: Important changes to original Privoxy:
- Use custom DNS servers
You can set DNS servers in config file to use specified DNS servers (of example, 8.8.8.8 and/or 208.67.222.222) instead of system-wide DNS settings. You can add no more than 6 DNS servers. Like:
dns-servers 8.8.8.8;208.67.222.222
Sample code (C#) of using the dll:
public class PrivoxyWrapper
{
[DllImport(@"LibPrivoxy.dll")]
public static extern int StartPrivoxy([MarshalAs(UnmanagedType.LPStr)] string configFileFullPath);
[DllImport(@"LibPrivoxy.dll")]
public static extern void StopPrivoxy();
[DllImport(@"LibPrivoxy.dll")]
public static extern int IsRunning();
}