Speno's Pythonic Avocado 1.1.2004


Faking ident for IRC

While abusing Twisted, I needed to seek out some experts on the #twisted IRC channel. Unfortunately, the freenode IRC network requires clients to support the ident protocol. I didn't want to install a "real" identd, so I faked one using Twisted. Here it is:

#!/usr/bin/python from twisted.internet import reactor from twisted.internet.protocol import Protocol, Factory class FakeIdent(Protocol): def dataReceived(self, data): """Send fake ident on any data received""" data = data.strip().replace(' ,',',') out = data + ' : USERID : UNIX : ircuser\r\n' self.transport.write(out) def main(): f = Factory() f.protocol = FakeIdent reactor.listenTCP(8000, f) reactor.run() if __name__ == '__main__': main()

I had my firewall redirect the standard ident port of 113 to port 8000 on my iBook. Once this program was running, I was able to join the freenode IRC network and talk to some of the Twisted developers.

If you want a much better fake ident server written in python, use fauxident.

posted at 20:07:12    #    comment []    trackback []
January 2004
    1 2 3 4
5 6 7 8 91011

One python programmer's search for understanding and avocados. This isn't personal, only pythonic.

XML-Image Letterimage

© 2004-2005, John P. Speno