LOG.warning(
'cannot check SSL/TLS hostname with Python %s' % sys.version)
- def connect(self, target, nickname,
- password=None, username=None, ircname=None, **kwargs):
+ def connect(self, target, nickname, username=None, realname=None,
+ **kwargs):
LOG.debug("connect(server=%r, port=%r, nickname=%r, ...)" % (
target.servername, target.port, nickname))
if self.socket is not None:
if target.ssl:
self._check_hostname(target=target)
- if password:
- self.ship("PASS " + password)
+ if target.password:
+ self.ship("PASS " + target.password)
self.nick(self.nickname)
- self.user(username=username or ircname, realname=ircname or nickname)
+ self.user(
+ username=target.username or username or 'irker',
+ realname=realname or 'irker relaying client')
return self
def close(self):
self.connection.connect(
target=self.target,
nickname=self.nickname(),
- username="irker",
- ircname="irker relaying client",
**self.kwargs)
self.status = "handshaking"
LOG.info("XMIT_TTL bump (%s connection) at %s" % (
default_ircport = 6697
else:
default_ircport = 6667
- irchost, _, ircport = parsed.netloc.partition(':')
- if not ircport:
- ircport = default_ircport
- self.servername = irchost
+ self.username = parsed.username
+ self.password = parsed.password
+ self.servername = parsed.hostname
+ self.port = parsed.port or default_ircport
# IRC channel names are case-insensitive. If we don't smash
# case here we may run into problems later. There was a bug
# observed on irc.rizon.net where an irkerd user specified #Channel,
self.key = ""
if parsed.query:
self.key = re.sub("^key=", "", parsed.query)
- self.port = int(ircport)
def __str__(self):
"Represent this instance as a string"
{"to":["irc://chat.freenode.net/#git-ciabot","irc://chat.freenode.net/#gpsd"],"privmsg":"Multichannel test"}
{"to":"irc://chat.hypothetical.net:6668/git-ciabot", "privmsg":"Hello, world!"}
{"to":"ircs://chat.hypothetical.net/git-private?key=topsecret", "privmsg":"Keyed channel test"}
+{"to":"ircs://:topsecret@chat.example.net/git-private", "privmsg":"Password-protected server test"}
</programlisting></para>
<para>If the channel part of the URL does not have one of the prefix
<application>irkerd</application> sends plaintext messages to the default
6667 IRC port of each server, and SSL/TLS messages to 6697.</para>
+<para>The password for password-protected servers can be set using the
+usual <quote>[{username}:{password}@]{host}:{port}</quote> defined in
+RFC 3986, as shown in the fifth example. Non-empty URL usernames
+override the default <quote>irker</quote> username.</para>
+
<para>When the <quote>to</quote> URL uses the <quote>ircs</quote>
scheme (as shown in the fourth and fifth examples), the connection to
the server is made via SSL/TLS (vs. a plaintext connection with the