Version 20 of Improving Tcl Chat

Updated 2003-01-23 01:56:10

This page was created to discuss how to improve the Tcl'ers Chat - JCW


So what's wrong? Well...

  • it's a CGI doing periodic refresh, that eats bandwidth and CPU resources and both are starting to become an issue
  • it is used by Bruce Hartweg's TkChat, which then has to go through the trouble of decoding stuff which was not really designed to be easy to parse and process further

There are lots of ways to take this further. Recent experiments with Cgi-irc (a web-based gateway to IRC) and with some experimental code I wrote at http://mini.net/t/ show that there are a number of issues before we have a satisfactory replacement:

  • first of all, the big advantage of the current system seems to be that it works through everyone's firewall
  • second, Ralf's Chat (see http://www.ralfchat.com/ ), as the perl script is called, does have quite a bit of features: login management, user lists, private msgs, and sending messages to someone who is not currently around

My goal for now is to quickly find a few simple and robust solutions to stay out of trouble with CPU load and bandwidth. The CPU load seems to already be making the Tcl'ers Wiki itself sluggish, especially with updates. And the bandwidth... well, I'm starting to reach the limit for this server, and more than 50% of it is the chat. If it grows much further, it'll cost (a small amount of) real bucks.

Here are some ideas for improving this:

  1. adjust the perl script to save a copy of the current history on file, in a format which can be easily read by TkChat, then adjust TkChat to read that page directly off the server, instead of via CGI
  2. save perhaps a second copy of the history as HTML with the header containing a "Refresh" item so it will self-refresh every 15s. Then adjust the perl script to point browsers to it. The idea is that with frames, the history frame can simply point to this page and self-refresh without any CGI in between. The impact is that the refresh period becomes fixed as 15s for everyone.

A bit further down the line, I'd like to also revisit the idea of having a CGI script which "pushes" a signal that the history has changed. It could be used by TkChat to listen to, instead of doing a periodic page poll/pull. This will need to be optional, since push will not work through all firewalls (proxying ones will probably not allow the push connection to be kept open).

Comments are welcome... what this all is meant to say is that we need to do something about the chat before it becomes a real problem on mini.net.

April 2002 - FWIW, the bandwidth and cpu load issues are no longer a concern (heftier machine, and much higher limit) -jcw


BBH - I have some ideas that might be helpful here (I've been meaning to send them to the maillist but things have been hectic lately) I'll get then translated from my head into something readable & post later


LV The mailing list to which Bruce refers is the TclersWiki list at yahoo.com - the URL for that group http://groups.yahoo.com/group/TclersWiki/ .


rmax I've created a little script to Tunnel IRC through HTTP proxies .


I'm not much of a web programmer (my newbie colors are apparent), but is it possible for the history page to not complete the HTTP transaction? And in that way have the server push continuing html when ready?

How about an IRC gateway, too? What if we linked the TclChat to a permanent channel on irc like irc.freenode.net/#tcl? I have a tcl extension that can manage an IRC connection and push out html for it's output. -- DG


That's exactly what ircbridge does, although at the moment, it's online more or less when I am - davidw.


ircbridge is looking really nice atm, but the real question is why do we even need ircbridge?? We have a chat system that's been round for eons, is relatively low-bandwidth, has several Tcl-based clients, doesn't require a web-browser, doesn't use CGIs and isn't written in Perl. My friends, it's called Internet Relay Chat, or IRC for short. Never could understand the fetishism with web-based chats. I mean, if you really really have to use a web browser for absolutely everything ("it's the Internet, man!") then use a web-based IRC client. Personally, I refuse to use a web-based hack.

-- Setok

From the Tcl Chatroom page:

So why are we putting so much into this Chat, rather than an IRC channel? It's almost entirely because some of the most active and important chatters are often behind corporate firewalls that block most ports (except http). It's that simple.

[PT] writes: Not only is the above true but int the worst cases the only access is via extremely restrictive proxy servers. For instance, the proxy I live behind refuses to honor the KeepAlive flag - although it claims to be HTTP/1.1 This prevents the use of the web based IRC clients. The Tcl chat works for everyone. ircbridge extends this into IRC space and if you can use or are happier using IRC for internet chat then you need not be excluded. For myself, and others, I cannot use IRC and policy means I will never be able to use it.


[ Category Tcler's Wiki | Category Internet ]