Oct 222014

Webchat logoXIN.at has been running an IRC chat server for some time now, but the problem always lies with people needing some client software to use it, like X-Chat or Nettalk or whatever.

People usually just don’t want to install yet another chat client software, no matter how old and well-established IRC itself may be. Alternatively, they can use some other untrusted web interface to connect to either the plain text [irc://www.xin.at:6666] or the encrypted [irc+ssl://www.xin.at:6697] server via a browser, but this isn’t optimal either. Since JavaScript cannot open TCP sockets on its own, and hence cannot connect to an IRC server directly, there are only two kinds of solutions:

  • Purely client-based as a Java Applet or Adobe Flash Applet, neither of wich are very good options.
  • JavaScript client + server backend for handling the actual communication with the IRC server.
    • Server backends exist in JavaScript/Node.js, Perl, Python, PHP etc.

Since I cannot run [Node.js] and [cgi:irc] is unportable due to its reliance on UNIX sockets, only Python and PHP remained. Since PHP was easier for me, I tried the old [WebChat2] software developed by Chris Chabot for this. To achieve connection-oriented encryption security, I wrapped SSL/TLS around the otherwise unencrypting PHP socket server of WebChat2. You can achieve this with cross-platform software like [stunnel], which can essentially wrap SSL around almost every servers connection (minus the complex FTP protocol maybe). While WebChat2’s back end is based on PHP, the front end uses JavaScript/Comet. This is what it looks like:

So that should do away with the “I don’t wanna install some chat client software” problem, especially when considering that most people these days don’t even know what Internet Relay Chat is anymore. ;) It also allows anonymous visitors on this web log to contact me directly, while allowing for a more tap-proof conversation when compared with what typical commercial solutions would give you (think WhatsApp, Skype and the likes). Well, it’s actually not more tap-proof considering the server operator can still read all communication at will, but I would like to believe that I am a more trustworthy server operator than certain big corporations. ;)

Oh, and if you finally do find it in yourself to use some good client software, check out [XChat] on Linux/UNIX and its fork [HexChat] on Windows, or [LimeChat] on MacOS X. There are mobile clients too, like for Android ([AndroIRC], [AndChat]), iOS ([SIRCL], [TurboIRC]), Windows Phone 8 ([IRC Free], [IRC Chat]), Symbian 9.x S60 ([mIRGGI]) and others.

So, all made easy now, whether client software or just web browser! Ah and before I forget it, here’s the link of course:

Edit: Currently, only the following browsers are known to work with the chat (older version may sometimes work, but are untested):

  • Mozilla FireFox 31+
  • Chromium (incl. Chrome/SRWare Iron) 30+
  • Opera 25+
  • Apple Safari 5.1.7+
  • KDE Konqueror 4.3.4+

The following browsers are known to either completely break or to make the interface practically unusable:

  • Internet Explorer <=11
  • Opera <=12.17

CC BY-NC-SA 4.0 Easy crypto web chat now available on XIN.at (using IRC backend) by The GAT at XIN.at is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

  3 Responses to “Easy crypto web chat now available on XIN.at (using IRC backend)”

  1. It works for FF24! (tried it before, but mistakenly thought I was using FF24ESR).

    However, the ascii-art is f00ked in the ‘info’-channel.

    • Hey Sjaak,

      True that. Actually, you made me check the ASCII, and it was quite dirty, with mixed line break types and I think even mixed encoding. It’s now a pure UNIX style UTF-8 file. But that doesn’t help either, because the web chat somehow consolidates multiple white spaces. It also does this when interactively chatting. I would need to find that crap in the source code and fix it… Not sure whether I can manage, but I’ll try.

    • Hey again,

      Ok, this was quite enlightening.

      First, HTML always consolidates whitespaces. Thus, if you write “blah       blah” in HTML, the rendered output will be “blah blah”. That’s what the &nbsp; entity is for of course. So I modified the front end JavaScript code to replace all whitespaces with &nbsp; strings. But that was only one part, as the web chat was using the Arial font. So I fixed the CSS and some more client-side JavaScript to use only monospace fonts. However, my MotD (Message of the Day) uses special Unicode glpyhs, that can be rendered by some the selected fonts (there is no near-complete Unicode monospace font anyway), but it somehow still fails on the web. So while the regular text and the simpler ASCII glyphs are rendered as monospace correctly, the special ones like ┅ ┅ ┅ or ██████ are not.

      It seems I cannot completely fix that, but at least it’s better than before. What really confuses me is that some of the selected fonts can render the crap perfectly in LibreOffice or X-Chat, but not on the web, no idea why. Maybe some other CSS fucking with me or something, although I doubt that. I’ll play around with it a bit, maybe I can find some clues. At least text in the chat is now generally more readable due to the monospace fonts, as long as your system has at least one of those fonts installed: DejaVu Sans Mono, Lucida Console, Courier New, Courier, Andale Mono or Monaco.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">