Skip to content

IRC

Human can connect to IRC servers and participate in channels. The connection is bidirectional: it joins and receives messages over a raw TCP socket, and sends via PRIVMSG.

  • Build with -DHU_ENABLE_IRC=ON or -DHU_ENABLE_ALL_CHANNELS=ON
  • Network access to the IRC server

Add to ~/.human/config.json. IRC expects a channels.irc array of account configs:

{
"channels": {
"irc": [
{
"host": "irc.libera.chat",
"port": 6667,
"nick": "human",
"channel": "#human",
"tls": false,
"allow_from": []
}
]
}
}
FieldTypeDescription
hoststringIRC server hostname (or server)
portnumberPort (default 6667 for plain, 6697 for TLS)
nickstringIRC nickname
channelstringChannel to join (e.g. #channelname)
tlsboolUse TLS for connection (default false)
allow_fromarrayNicknames or masks to allow. Empty = allow all

Refer to src/channels/irc.c for the exact config schema. The implementation accepts server and port; nick and channel are used by the channel loop/dispatcher when connecting and joining.

  • Resolves host via getaddrinfo, connects with a streaming socket
  • Default port 6667 (plain) or 6697 (TLS)
  • On start, the channel connects to the server; connection is kept open
  • Sends PRIVMSG <target> :<message>\r\n over the socket
  • Long messages are split into chunks (max ~400 chars per line to stay under 512-byte IRC limit)
  • Target is typically #channelname or a nickname for DMs
  • Polling-based: the channel loop reads from the socket
  • Incoming PRIVMSG and NOTICE are parsed and delivered to the agent
  • Poll interval: 1000 ms
  • Plain TCP by default: TLS support depends on build; current implementation may use raw sockets
  • Single connection per config: Each array entry is one IRC connection
  • No SASL/auth: Authentication (e.g. NickServ) is not built in; configure separately if required