parse

Parse IRC URLs (also known as "chat links").

Channels without a valid prefix are automatically prefixed with '#'.

parse
@safe
(
string url
)

Examples

1 ConnectionInfo info;
2 
3 info = parse("ircs://irc.example.com:6697/foo,bar");
4 
5 assert(info.address == "irc.example.com");
6 assert(info.explicitPort == 6697);
7 assert(info.port == 6697);
8 assert(info.secure);
9 assert(info.channels == ["#foo", "#bar"]);
10 
11 info = parse("irc://irc.example.org/foo?pass");
12 
13 assert(info.address == "irc.example.org");
14 assert(info.explicitPort == 0);
15 assert(info.port == 6667); // No explicit port, so it falls back to the default IRC port
16 assert(!info.secure);
17 assert(info.channels == ["#foo"]);
18 assert(info.channelKey == "pass");

Meta