knusbaum / cl-gopher

Gopher library in Common Lisp
6 stars 2 forks source link

Add support for Tor onion gopher holes #6

Open hendursaga opened 2 years ago

hendursaga commented 2 years ago

Nyxt is using this library for its Gopher support, and I realized I couldn't access any (admittedly few) Tor onion sites, such as gopher://gnr2pc7do3kxgj2r4awdpcg5inaxrqb3tbfii7ubjhkdbzl7xuom5gyd.onion or gopher://magicalxot2nosefso27zfzuujuaphtznzn3ng7q44u426s6bkiuvzqd.onion. I've traced it to with-gopher-socket-for-selector where it uses usocket to lookup DNS records, which would obviously fail since Tor uses its own domain resolution scheme.

Should I report this further upstream to usocket? I'm not sure what the best solution for a workaround would be in the meantime. Whatever solution we come up with, it would be good to make it generic enough so that, say, I2P or IPFS support could easily be added. I know gopher://khzae.net at least used to have I2P support. It still has an aforementioned v3 onion address.

P.S. how might I make a clickable Gopher URL in GFM?

hendursaga commented 2 years ago

If you need a Gopher URL to test, try gopher://magicalxot2nosefso27zfzuujuaphtznzn3ng7q44u426s6bkiuvzqd.onion

knusbaum commented 1 year ago

Thanks, @hendursaga .

Unfortunately I don't have time to work on this right now, but I'd welcome any PRs if you want to look at supporting it.

It looks like Nyxt is published under the BSD-3-clause license, so you should be able to get inspiration from its source if you want to see how they do it.