ipfs-gateway.d 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. c: Copyright (C) 2023, Mark Gaiser, <markg85@gmail.com>
  2. SPDX-License-Identifier: curl
  3. Long: ipfs-gateway
  4. Arg: <URL>
  5. Help: Gateway for IPFS
  6. Added: 8.4.0
  7. See-also: help manual
  8. Category: ipfs
  9. Example: --ipfs-gateway $URL ipfs://
  10. Multi: single
  11. ---
  12. Specifies which gateway to use for IPFS and IPNS URLs.
  13. Not specifying this argument will let cURL try to automatically
  14. check if IPFS_GATEWAY environment variable is set,
  15. or if ~/.ipfs/gateway plain text file exists.
  16. If you run a local IPFS node, this gateway is by default
  17. available under http://localhost:8080. A full example URL would
  18. look like:
  19. curl --ipfs-gateway http://localhost:8080 ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi
  20. You can also specify publicly available gateways. One such
  21. gateway is https://ipfs.io. A full example url would look like:
  22. curl --ipfs-gateway https://ipfs.io ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi
  23. There are many public IPFS gateways. As a starting point to find
  24. one that works for your case, consult this page:
  25. https://ipfs.github.io/public-gateway-checker/
  26. A word of caution! When you opt to go for a remote gateway you should
  27. be aware that you completely trust the gateway. This is fine in local gateways
  28. as you host it yourself. With remote gateways there could potentially be
  29. a malicious actor returning you data that does not match the request you made,
  30. inspect or even interfere with the request. You won't notice this when using cURL.
  31. A mitigation could be to go for a "trustless" gateway. This means you
  32. locally verify that the data. Consult the docs page on trusted vs trustless:
  33. https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless