xref: /curl/docs/cmdline-opts/ipfs-gateway.md (revision 0066d169)
1---
2c: Copyright (C) Mark Gaiser, <markg85@gmail.com>
3SPDX-License-Identifier: curl
4Long: ipfs-gateway
5Arg: <URL>
6Help: Gateway for IPFS
7Protocols: IPFS
8Added: 8.4.0
9Category: curl
10Multi: single
11See-also:
12  - help
13  - manual
14Example:
15  - --ipfs-gateway $URL ipfs://
16---
17
18# `--ipfs-gateway`
19
20Specify which gateway to use for IPFS and IPNS URLs. Not specifying this
21instead makes curl check if the IPFS_GATEWAY environment variable is set, or
22if a `~/.ipfs/gateway` file holding the gateway URL exists.
23
24If you run a local IPFS node, this gateway is by default available under
25`http://localhost:8080`. A full example URL would look like:
26
27    curl --ipfs-gateway http://localhost:8080 \
28       ipfs://bafybeigagd5nmnn2iys2f3
29
30There are many public IPFS gateways. See for example:
31https://ipfs.github.io/public-gateway-checker/
32
33If you opt to go for a remote gateway you need to be aware that you completely
34trust the gateway. This might be fine in local gateways that you host
35yourself. With remote gateways there could potentially be malicious actors
36returning you data that does not match the request you made, inspect or even
37interfere with the request. You may not notice this when using curl. A
38mitigation could be to go for a "trustless" gateway. This means you locally
39verify that the data. Consult the docs page on trusted vs trustless:
40https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless
41