Skip to content

Commit 597516e

Browse files
Switch plaintext sections (ipfs#1463)
Co-authored-by: ElPaisano <113373882+ElPaisano@users.noreply.github.com>
1 parent 9068dc8 commit 597516e

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

docs/how-to/address-ipfs-on-web.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,58 @@ User agents that support IPFS, such as a browser with [ipfs-companion](https://d
5757

5858
## Path gateway
5959

60-
In the most basic scheme, a URL path used for content addressing is effectively a resource name without a canonical location. The HTTP server provides the location part, which makes it possible for browsers to interpret an IPFS content path as relative to the current server and just work without a need for any conversion:
60+
In the most basic scheme, a URL path used for content addressing is effectively a resource name without a canonical location. The HTTP server provides the location part, which makes it possible for browsers to interpret an IPFS content path as relative to the current server and just work without a need for any conversion. Given a gateway host address (such as `ipfs.io`) and a path to the resource, (`/path/to/resource`), a [CID](../concepts/content-addressing.md) (`<cid>`), IPNS ID (`<ipnsid>`) or [DNSLink](../concepts/dnslink/) (`<dnslink>`) can all be used.
61+
62+
- [Using a CID](#using-a-cid)
63+
- [Using IPNS](#using-ipns)
64+
- [Using DNSLink](#using-dnslink)
65+
66+
### Using a CID
67+
Given a CID `<cid>`, a URL path can be constructed as follows:
6168

6269
```plaintext
6370
https://<gateway-host>.tld/ipfs/<cid>/path/to/resource
64-
https://<gateway-host>.tld/ipns/<ipnsid_or_dnslink>/path/to/resource
6571
```
6672

67-
::: danger
68-
In this scheme, all pages share a [single origin](https://en.wikipedia.org/wiki/Same-origin_policy), which means this type of gateway should be used only when site isolation does not matter (static content without cookies, local storage, or Web APIs that require user permission).
69-
70-
When in doubt, use [subdomain gateway](#subdomain-gateway).
71-
:::
72-
73-
Examples:
73+
Example:
7474

7575
```plaintext
7676
https://ipfs.io/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/Vincent_van_Gogh.html
7777
https://ipfs.io/ipfs/QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX/wiki/Mars.html
78+
```
79+
80+
### Using IPNS
81+
Given an IPNS `<ipnsid>`, a URL path can be constructed as follows:
82+
83+
```plaintext
84+
https://<gateway-host>.tld/ipns/<ipnsid>/path/to/resource
85+
```
86+
87+
Example:
88+
89+
```plaintext
90+
https://ipfs.io/ipns/k51qzi5uqu5dlvj2baxnqndepeb86cbk3ng7n3i46uzyxzyqj2xjonzllnv0v8
91+
```
92+
93+
### Using DNSLink
94+
Given a DNSLink `<dnslink>`, a URL path can be constructed as follows:
95+
96+
```plaintext
97+
https://<gateway-host>.tld/ipns/<dnslink>/path/to/resource
98+
```
99+
100+
Example:
101+
102+
```plaintext
78103
https://ipfs.io/ipns/tr.wikipedia-on-ipfs.org/wiki/Anasayfa.html
79104
```
80105

106+
::: danger
107+
In this scheme, all pages share a [single origin](https://en.wikipedia.org/wiki/Same-origin_policy), which means this type of gateway should be used only when site isolation does not matter (static content without cookies, local storage, or Web APIs that require user permission).
108+
109+
When in doubt, use [subdomain gateway](#subdomain-gateway).
110+
:::
111+
81112
## Subdomain gateway
82113

83114
When [origin-based security](https://en.wikipedia.org/wiki/Same-origin_policy) is needed, [CIDv1](../concepts/content-addressing.md#identifier-formats) in case-insensitive encoding such as Base32 or Base36 should be used in the subdomain:

0 commit comments

Comments
 (0)