Using Squid Proxy with IPWorks Components


Squid is an HTTP proxy supported by IPWorks components. While it handles standard HTTP requests directly, HTTPS requests require HTTP tunneling to pass through the proxy.

To access HTTPS resources through a Squid proxy, configure the component to use tunneling:

[Test]
public void HTTPSquidProxyTest()
{
  Https https1 = new Https();
 
  // Configure Squid proxy for HTTPS (tunneling)
  https1.Firewall.FirewallType = FirewallTypes.fwTunnel;
  https1.Firewall.Host = "62.2.204.30";
  https1.Firewall.Port = 8080;
 
  https1.Get("https://www.microsoft.com");
}

For non-SSL (HTTP) requests, you can either use the same tunneling approach (with an http:// URL), or configure the proxy directly:

[Test]
public void HTTPSquidProxyHttpTest()
{
  Https https1 = new Https();
 
  // Configure Squid proxy for HTTP
  https1.ProxyServer = "62.2.204.30";
  https1.ProxyPort = 8080;
 
  https1.Get("https://www.microsoft.com");
}

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.