ERC and IRSSI - an unlikely pair

For those who lurk IRC channels, the initially obvious solution is to run IRSSI or your IRC connection of choice from within tmux or screen so that you can remain connected, identified and all that good stuff 24/7. Unfortunately, at least for my fellow emacs users, attaching to a screen or tmux session isn’t possible from within emacs and thus is sacralidge not acceptable in our workflow.

But fear not my friends, for there exists a solution!

Enter irssi, irssiproxy and irssinotify.

irssi is an awesome terminal based IRC client, and consequently is an awesome candidate for running within screen or tmux as your tastes permit. I’ll leave getting started with IRSSI to other well written sites, and move merilly along to the point of this article which is irssi’s proxy extension, the notifier plugin and my setup to tie them all together.

irssiproxy is a standard extension for IRSSI which enables IRSSI to run it’s own internal IRC server and serve as a proxy same as ZNC or BNC. Once you have a working IRSSI client connected to a couple chatnets, all you need to do is run the command

/SET irssiproxy_ports [<net-name>=<bindable-port> ]+

This will create an internal IRC server within IRSSI, accessible on 0.0.0.0 (all addresses) on the port specified. Because irssi binds on all ports, all addresses I highly reccomend setting a server password too. Ideally one would also change the bind ports to for instance only bind over VPN, but I haven’t investigated how to do this yet.

Note when setting up irssiproxy that the command

cp libproxy.so ~/.irssi/modules/

is critical. This adds the irssiproxy module to irssi’s autoloads, so that when you start up irssi you don’t have to type in /load proxy. Alternatively you could add load proxy to ~/.irssi/startup (which is what I have), but either way loading the proxy at startup is a Good Thing (TM).

irssinotifier is an awesome irssi user script with really good setup documentation. It uses Google’s push service to send push events essentially in real time to any Android device you control whenever you are pinged on IRC. It’s surprisingly useful, the only drawbacks are that I don’t have a nice way to respond from my phone yet and that you will get push alerts when connected to the proxy.

The Full Setup

So here’s what you’ll end up with at the end of the day.

~/.irssi
    ./config                   # channels, themes and soforth
	./modules
	    ./libproxy.so          # the proxy library
	./scripts
	     ./autoload
		     ./irssi_notify.pl # the notifier library

I also run the irssi scren user script, which can interact nicely with irssinotifier to disable push notifications when you are attached to the containing screen session. Unfortunately it doesn’t interact with proxy, so attaching to the proxy won’t mark you as attached and won’t disable push notifications.

In my configuration, I have a VPN connecting my fileserver, laptop, desktop, webserver and a bunch of other secured devices. The webserver runs this irssi configuration and offers the irssiproxy to my VPN, using SSL upstream to the irc networks. I then connect over the VPN from ERC running in my local emacs instance to the proxy. Bam. IRC distractions seamlessly in your editor!

^d