Commits

Cédric Bonhomme committed cf56437

irker's host and port can be configured in the configuration file.

Comments (0)

Files changed (3)

 nb_bits = 752
 [irc]
 channel = irc://chat.freenode.net/#testpyHIDS
+host = localhost
+port = 6659
 [email]
 enabled = 0
 mail_from = pyHIDS@no-reply.com
 NB_BITS = int(config.get('globals','nb_bits'))
 
 IRC_CHANNEL = config.get('irc','channel')
+IRKER_HOST = config.get('irc','host')
+IRKER_PORT = int(config.get('irc','port'))
 
 MAIL_ENABLED = bool(int(config.get('email','enabled')))
 MAIL_FROM = config.get('email','mail_from')
     irker_lock.acquire()
     data = {"to": target, "privmsg" : message}
     try:
-        s = socket.create_connection(("localhost", 6659))
+        s = socket.create_connection((conf.IRKER_HOST, conf.IRKER_PORT))
         s.sendall(json.dumps(data).encode('utf-8'))
     except socket.error as e:
         sys.stderr.write("irkerd: write to server failed: %r\n" % e)