parse

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

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

@safe
parse
(
string url
)

Examples

ConnectionInfo info;

info = parse("ircs://irc.example.com:6697/foo,bar");

assert(info.address == "irc.example.com");
assert(info.explicitPort == 6697);
assert(info.port == 6697);
assert(info.secure);
assert(info.channels == ["#foo", "#bar"]);

info = parse("irc://irc.example.org/foo?pass");

assert(info.address == "irc.example.org");
assert(info.explicitPort == 0);
assert(info.port == 6667); // No explicit port, so it falls back to the default IRC port
assert(!info.secure);
assert(info.channels == ["#foo"]);
assert(info.channelKey == "pass");

Meta