curl: add support for the IPFS protocols:

- ipfs://<cid>
- ipns://<cid>

This allows you tu use ipfs in curl like:
curl ipfs://<cid>
and
curl ipns://<cid>

For more information consult the readme at:
https://curl.se/docs/ipfs.html

Closes #8805
This commit is contained in:
Mark Gaiser 2022-03-27 01:31:58 +01:00 committed by Daniel Stenberg
parent 5595e33617
commit 65b563a96a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
21 changed files with 678 additions and 31 deletions

View file

@ -116,6 +116,7 @@ static const struct LongShort aliases[]= {
{"*r", "create-dirs", ARG_BOOL},
{"*R", "create-file-mode", ARG_STRING},
{"*s", "max-redirs", ARG_STRING},
{"*S", "ipfs-gateway", ARG_STRING},
{"*t", "proxy-ntlm", ARG_BOOL},
{"*u", "crlf", ARG_BOOL},
{"*v", "stderr", ARG_FILENAME},
@ -1137,6 +1138,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
err = PARAM_BAD_NUMERIC;
break;
case 'S': /* ipfs gateway url */
GetStr(&config->ipfs_gateway, nextarg);
break;
case 't': /* --proxy-ntlm */
if(!feature_ntlm) {
err = PARAM_LIBCURL_DOESNT_SUPPORT;