xref: /curl/docs/cmdline-opts/ipfs-gateway.md (revision 6e494a23)
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: ipfs
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 ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi
28
29There are many public IPFS gateways. See for example:
30https://ipfs.github.io/public-gateway-checker/
31
32If you opt to go for a remote gateway you need to be aware that you completely
33trust the gateway. This might be fine in local gateways that you host
34yourself. With remote gateways there could potentially be malicious actors
35returning you data that does not match the request you made, inspect or even
36interfere with the request. You may not notice this when using curl. A
37mitigation could be to go for a "trustless" gateway. This means you locally
38verify that the data. Consult the docs page on trusted vs trustless:
39https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless
40