View | Details | Raw Unified | Return to bug 252128
Collapse All | Expand All

(-)b/lib/libfetch/fetch.3 (-2 / +20 lines)
Lines 624-632 The document part is ignored. Link Here
624
Only HTTP proxies are supported for HTTP requests.
624
Only HTTP proxies are supported for HTTP requests.
625
If no port number is specified, the default is 3128.
625
If no port number is specified, the default is 3128.
626
.Pp
626
.Pp
627
Note that this proxy will also be used for FTP documents, unless the
627
Note that this proxy will also be used for FTP and HTTPS documents,
628
unless the
628
.Ev FTP_PROXY
629
.Ev FTP_PROXY
629
variable is set.
630
and
631
.Ev HTTPS_PROXY
632
variables are set respectively.
630
.It Ev http_proxy
633
.It Ev http_proxy
631
Same as
634
Same as
632
.Ev HTTP_PROXY ,
635
.Ev HTTP_PROXY ,
Lines 650-655 Specifies the User-Agent string to use for HTTP requests. Link Here
650
This can be useful when working with HTTP origin or proxy servers that
653
This can be useful when working with HTTP origin or proxy servers that
651
differentiate between user agents.
654
differentiate between user agents.
652
If defined but empty, no User-Agent header is sent.
655
If defined but empty, no User-Agent header is sent.
656
.It Ev HTTPS_PROXY
657
URL of the proxy to use for HTTPS requests.
658
The document part is ignored.
659
Only HTTP proxies are supported for HTTPS requests.
660
If no port number is specified, the default is 3128.
661
.Pp
662
If this variable is set to an empty string, no proxy will be used for
663
HTTPS requests, even if the
664
.Ev HTTP_PROXY
665
variable is set.
666
.It Ev https_proxy
667
Same as
668
.Ev HTTPS_PROXY ,
669
for compatibility.
653
.It Ev NETRC
670
.It Ev NETRC
654
Specifies a file to use instead of
671
Specifies a file to use instead of
655
.Pa ~/.netrc
672
.Pa ~/.netrc
Lines 847-852 examples of this are Link Here
847
and FTP proxy support.
864
and FTP proxy support.
848
.Pp
865
.Pp
849
There is no way to select a proxy at run-time other than setting the
866
There is no way to select a proxy at run-time other than setting the
867
.Ev HTTPS_PROXY ,
850
.Ev HTTP_PROXY
868
.Ev HTTP_PROXY
851
or
869
or
852
.Ev FTP_PROXY
870
.Ev FTP_PROXY
(-)b/lib/libfetch/http.c (-9 / +23 lines)
Lines 1467-1481 http_get_proxy(struct url * url, const char *flags) Link Here
1467
		return (NULL);
1467
		return (NULL);
1468
	if (fetch_no_proxy_match(url->host))
1468
	if (fetch_no_proxy_match(url->host))
1469
		return (NULL);
1469
		return (NULL);
1470
	if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) &&
1470
	if (strcmp(url->scheme, SCHEME_HTTPS) == 0) {
1471
	    *p && (purl = fetchParseURL(p))) {
1471
		if (((p = getenv("HTTPS_PROXY")) || (p = getenv("https_proxy")) ||
1472
		if (!*purl->scheme)
1472
		(p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) &&
1473
			strcpy(purl->scheme, SCHEME_HTTP);
1473
		*p && (purl = fetchParseURL(p))) {
1474
		if (!purl->port)
1474
			if (!*purl->scheme)
1475
			purl->port = fetch_default_proxy_port(purl->scheme);
1475
				strcpy(purl->scheme, SCHEME_HTTP);
1476
		if (strcmp(purl->scheme, SCHEME_HTTP) == 0)
1476
			if (!purl->port)
1477
			return (purl);
1477
				purl->port = fetch_default_proxy_port(purl->scheme);
1478
		fetchFreeURL(purl);
1478
			if (strcmp(purl->scheme, SCHEME_HTTP) == 0)
1479
				return (purl);
1480
			fetchFreeURL(purl);
1481
		}
1482
	} else {
1483
		if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) &&
1484
		*p && (purl = fetchParseURL(p))) {
1485
			if (!*purl->scheme)
1486
				strcpy(purl->scheme, SCHEME_HTTP);
1487
			if (!purl->port)
1488
				purl->port = fetch_default_proxy_port(purl->scheme);
1489
			if (strcmp(purl->scheme, SCHEME_HTTP) == 0)
1490
				return (purl);
1491
			fetchFreeURL(purl);
1492
		}
1479
	}
1493
	}
1480
	return (NULL);
1494
	return (NULL);
1481
}
1495
}

Return to bug 252128