freebsd-skq/lib/libfetch
kevans bf579e30a4 fetch(3): Add SOCKS5 support
This change adds SOCKS5 support to the library fetch(3) and updates the man
page.

Details: Within the fetch_connect() function, fetch(3) checks if the
SOCKS5_PROXY environment variable is set. If so, it connects to this host
rather than the end-host. It then initializes the SOCKS5 connection in
accordance with RFC 1928 and returns the resulting conn_t (file descriptor)
for usage by the regular FTP/HTTP handlers.

Design Decision: This change defaults all DNS resolutions through the proxy
by sending all IPs as hostnames. Going forward, another feature might be to
create another environmental variable to toggle resolutions through the
proxy or not..

One may set the SOCKS5_PROXY environment variable in any of the formats:

SOCKS5_PROXY=proxy.example.com
SOCKS5_PROXY=proxy.example.com:1080
SOCKS5_PROXY=192.0.2.0
SOCKS5_PROXY=198.51.100.0:1080
SOCKS5_PROXY=[2001:db8::1]
SOCKS5_PROXY=[2001:db8::2]:1080

Then perform a request with fetch(1).

(note by kevans)
I've since been informed that Void Linux/xbps has a fork of libfetch that
also implements SOCKS5. I may compare/contrast the two in the mid-to-near
future.

Submitted by:	Farhan Khan <farhan farhan codes>
Differential Revision:	https://reviews.freebsd.org/D18908
2020-02-15 18:03:16 +00:00
..
common.c fetch(3): Add SOCKS5 support 2020-02-15 18:03:16 +00:00
common.h fetch(3): Add SOCKS5 support 2020-02-15 18:03:16 +00:00
fetch.3 fetch(3): Add SOCKS5 support 2020-02-15 18:03:16 +00:00
fetch.c libfetch: disallow invalid escape sequences 2020-02-05 16:55:00 +00:00
fetch.h lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
file.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
ftp.c Improve URL parsing. In particular, convert scheme and host to lowercase. 2018-11-27 10:45:14 +00:00
ftp.errors
http.c Document fetchReqHTTP(). 2019-08-28 17:01:28 +00:00
http.errors
Makefile pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Makefile.depend.options Add Makefile.depend.options 2019-12-11 17:37:37 +00:00