~alcinnz/hurl

ref: 3cd22771a5742dfd7e70f13153f75737e31027c0 hurl/ISSUES/new-protocols.md -rw-r--r-- 1.3 KiB
3cd22771 — Adrian Cochrane Add Gemini support. 4 years ago
                                                                                
e2baa089 Adrian Cochrane
2c81ab56 Adrian Cochrane
e2baa089 Adrian Cochrane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Support additional protocols
As mentioned in the README, I'd add like to add support for more URI schemes to
HURL. Here I'll list how I might implement them:

## ftp(s):
Network.FTP.Conduit.createSource looked convenient, but will likely be
incompatible with dependency versions.

Network.FTP.Client.retr, .withFTP(S), & possibly .login looks almost as easy.
Though I now that I tried it, I faced the same issues. Help updating this package
will be appreciated.

## magnet:
There's a `bittorrent` package, but it appears to be unmaintained and not up to
scratch for my needs.

## gemini:
The Network.Connection module allows me to open a TLS connection, write a line
from it, and read a line from it.

mWhile (connectionWaitForInput -1) connectionGetChunk should read the full file.

May want to parse response header (after converter to UTF-8) via uncons & strip.

Since the protocol takes a URL and returns a mimetype, error code, & data it
should fit right in. And it's markdown looks trivial to parse into HTML the
rest of Rhapsode can handle. It should slot right in!

## gopher:
Would need more conversion effort, to extract from the URL and convert them to
MIMEtypes. And if we want decent audio output, those would need to be parsed
according to sometimes undefined standards.

But should be easily implementable using the same APIs as for Gemini!