irssi proxy configuration

Overview

You want to have a universal connection to your IRC channels that you can proxy through (attach to from wherever and be your same /nick). This electronic paper will electrify your life by showing the pertinent parts to configure and use irssi proxy.

Proxy Setup

Ideally you want a machine that is on at all times to serve as the proxy. You want to be able to connect to it from anywhere anytime right?

Add to your .irssi/config file the following info tailored to your needs. Below, I’m configuring a proxy to two different IRC servers:

Servers

servers = (
  {
    address = "irc.perl.org";
    chatnet = "perl";
    port = "6667";
    use_ssl = "no";
    ssl_verify = "no";
    autoconnect = "yes";
  },
  {
    address = "irc.example.org";
    chatnet = "catinthehat";
    port = "6667";
    use_ssl = "no";
    ssl_verify = "no";
    autoconnect = "yes";
  },
);

Chatnets

Define the chatnets above as IRC based:

chatnets = {
  perl = { type = "IRC"; };
  catinthehat = { type = "IRC"; };
};

Channels

This part says which channels on which servers (chatnet) you want to automatically join, i.e. on startup.

channels = (
  { name = "#catalyst"; chatnet = "perl"; autojoin = "yes"; },
  { name = "#dbix-class"; chatnet = "perl"; autojoin = "yes"; },
  { name = "#reaction"; chatnet = "perl"; autojoin = "yes"; },
  { name = "#mojomojo"; chatnet = "perl"; autojoin = "yes"; },
  { name = "#barcelona.pm"; chatnet = "perl"; autojoin = "yes"; },
  { name = "#green-eggs"; chatnet = "catinthehat"; autojoin = "yes"; },
);

Settings

The key part here is the proxy option: Notice we define ports for each chatnet server we want to connect to.

settings = {
  core = {
    real_name = "bugs bunny";
    user_name = "bugsy";
    nick = "bugsy";
  };
  "fe-text" = { actlist_sort = "refnum"; };
  proxy = {
    irssiproxy_password = "yeah_right";
    irssiproxy_ports = "perl=3333 catinthehat=3334";
  };
  "fe-common/core" = {
    autolog = "yes";
    AUTOLOG_LEVEL = "MSGS PUBLIC ACTIONS HILIGHT TOPICS SNOTES CTCPS MODES INVITES CLIENTNOTICE CLIENTERROR";
  };
};

Proxy Startup

I run the irssi proxy on a virtual server and at times I like to attach directly to it for chatting. Thus I start the irrsi and its proxy using screen:

screen -S irc irssi

This starts irssi and its proxy mode based on the above configuration as the screen session named irc.

I like to start irssi and it’s proxy via screen so I have the option of attaching

Establish Connection from Client Machine to Proxy Server

Ok, now that we’ve got the proxy rolling, we can use it directly by logging in and attaching the screen process via:

Attach to screen irssi session on proxy server

screen -r irc

SSH Tunnel to Proxy Server from a Client Machine

You may or may have not noticed in the Settings above we configured irssi proxy ports 3333 and 3334. These are the ports we connect to from the client machine like so:

#!/bin/sh
/usr/bin/screen -S tunnel ssh -L 3334:localhost:3334 -L 3333:localhost:3333 user@irssi.proxy.org

NOTE: Again I’m using screen to setup a ssh tunnel from a local port to a remote port. I happened to use the same port on each side, but you can do whatever you want on the local side. The remote ports have to match the irssiproxy_ports settings in the irssi config file.

Configure Your IRC Client

We are so close, I can already smell the sweet aroma of success. We have the proxy and route to it from our client machine. Now we just have to configure our IRC client. It just needs to know about the local side of the configuration. i.e. what port gives us what IRC server. The key components are:

  • server: localhost
  • port: 3333, 3334 like above or what other choices you made for the local side of the tunnel.

That will enable you to configure your IRC client to know where to look locally then it will automatically pass on through to the proxy. You should now be able to use an IRC client from an arbitrary machine to proxy through your own custom irssi proxy instance.

My tags:
 
Popular tags:
 
Powered by MojoMojo