cURL / Mailing Lists / curl-users / Single Mail


Curl and transparent proxies (e.g. Squid)

From: <>
Date: Wed, 2 Jul 2014 10:57:47 +0200
Hello all and best greetings,
I already did quite some research on various sources in the net but was not able to find anything helpful for my particular problem.
The screnario is that I have some client PCs in a network behind a transparent proxy (squid/3.1.12).
Everything works fine using a browser set to "automatically detect network settings". Interestingly, if I set the browser to "no proxy" as I would have expected to be possible when using transparent proxies, the browser is not able to get anything from the web.
But how do I configure curl in this scenario?
If I omit proxy settings entirely, I get a "connection refused" error on every URL I want to access.
If I provide the proxy address and port with the -proxy option, I get the following:
E:\apps\flash>curl -x -v
* About to connect() to proxy port 80 (#0)
*   Trying
* Connected to ( port 80 (#0)
> GET HTTP/1.1
> User-Agent: curl/7.29.0
> Host:
> Accept: */*
> Proxy-Connection: Keep-Alive
< HTTP/1.1 404 Not Found
< Date: Wed, 02 Jul 2014 08:55:07 GMT
< Server: Apache/2.2.12 (Linux/SUSE)
< Vary: accept-language,accept-charset
< Accept-Ranges: bytes
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=iso-8859-1
< Content-Language: en
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" lang="en" xml:lang="en">
<title>Object not found!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
<h1>Object not found!</h1>

    The requested URL was not found on this server.
    If you entered the URL manually please check your
    spelling and try again.
If you think this is a server error, please contact
the <a href="mailto:%5bno%20address%20given%5d">webmaster</a>.
<h2>Error 404</h2>
  <a href="/"></a><br />
  <span>Wed Jul  2 10:55:07 2014<br />
  Apache/2.2.12 (Linux/SUSE)</span>
* Connection #0 to host left intact
What settings do I have to provide to curl so that it can handle that transparent proxy properly?
Thank you very much for your help in advance and kind regards,

List admin:
Received on 2014-07-02