Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit eafd04f

Browse files
author
Joe Hand
authored
Merge pull request #5 from millette/notes
Notes on dat URLs.
2 parents c3845d7 + 157c648 commit eafd04f

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,47 @@ Resolution order:
4343
3. Check JSON request response for `key`
4444
4. Dat-DNS resolution via [dat-dns](https://github.com/datprotocol/dat-dns)
4545

46+
## Refering to dats
47+
Trying to tighten up a bit dat-link-resolve (and its dependencies dat-dns and dat-decode). I am noticing a few inconsistencies as I'm writing dat-shell.
48+
49+
Ideally, I'd like to launch dat-shell like this:
50+
```sh
51+
$ dat-shell dat://40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9+5/path4
52+
```
53+
54+
and have it open the dat at version 5 and change directory to /path4.
55+
56+
Currently ```dat-shell google-fonts-kewitz.hashbase.io/fonts/``` [fails somewhere in dat-link-resolve](https://github.com/millette/dat-shell/issues/5).
57+
58+
### Examples
59+
Note that dat-link-resolve also supports other methods, such as detection of dat keys in paths and http headers.
60+
61+
#### Simplest
62+
* Plain: 40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9
63+
* DNS: pfrazee.hashbase.io
64+
65+
#### With version
66+
* Plain: 40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9+5
67+
* DNS: pfrazee.hashbase.io+5
68+
69+
#### With scheme
70+
* https: https://40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9/
71+
* dat: dat://pfrazee.hashbase.io
72+
73+
#### With path
74+
* https: 40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9/path1
75+
* dat: pfrazee.hashbase.io/path2
76+
77+
#### Combinations
78+
* 40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9+5/path3
79+
* dat://40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9+5/path4
80+
* https://40a7f6b6147ae695bcbcff432f684c7bb5291ea339c28c1755896cdeb80bd2f9/path5 [(^1)][]
81+
* https://pfrazee.hashbase.io+5/path6 [(^2)][]
82+
83+
### Notes
84+
1. browsers expect http and https schemes with traditional hostname, not a dat key
85+
2. browsers expect http and https schemes with traditional hostname, no +5 (version) support
86+
4687
## Contributing
4788

4889
Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.
@@ -57,3 +98,5 @@ Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md
5798
[travis-url]: https://travis-ci.org/joehand/dat-link-resolve
5899
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
59100
[standard-url]: http://npm.im/standard
101+
[(^1)]: <#notes>
102+
[(^2)]: <#notes>

0 commit comments

Comments
 (0)