Advice on writing an instant messaging proxy

From: Yan (rottled_at_gmail.com)
Date: 01/11/05

  • Next message: Bryan Hoover: "Re: If I'm not a programmer, then what am I? ;)"
    Date: Tue, 11 Jan 2005 01:53:55 GMT
    
    

    Hey guys.

            I wanted to write something significant (to myself) for a while to get
    a better grasp of C in general, and unix programming. I have decided on
    what I want to write, but after about a week of thinking of how I want
    to implement what I had in my mind, which is as follows:
            I want to write a proxy-like system for AIM and other instant messaging
    platforms. With a major and quite a few minor features. The major
    feature of the proxy will be to keep the user connected after he has
    disconnected from the service, and log events, to have them available at
    the next time the user connects to the proxy. (Single instance of proxy
    has to support multiple connections). In more detail:
                    
            1. User connects to proxy, all traffic goes through, with some
    filtering/logging (to be explained later).
            2. After the client disconnects, the proxy does not forward this
    disconnection to the AIM (or whatever other chat protocol) server, and
    keeps sending keep alive packets, logging events (events being messages
    received, buddies signing on/off, buddies changing statuss, etc)
            3. Next time the user connects through the proxy, the AIM client
    completes the authorization with the proxy, and the proxy connects the
    client to server as if client was always connected, and makes all logged
    information available (implementation specific detail: add a username to
    the buddy list of the proxy, which proxy will receive commands on, and
    send back command results)
            4. Once a command is issues to the proxy that the client wants to
    completely disconnect, next time the client disconnects, the proxy kills
    off connection as well.

            Some minor, but necessary, features that I want to implement (as
    mentioned earlier) is message logging (to file or database), message
    filtering, hard rate limit support (queue all messages and only dispatch
    such that rate limit supports), strip formatting (some people think it's
    cool to use yellow font on white background in Comic Sans), simple
    analysis (Most talked to screen name, average message length, word
    frequency, just random statistics). Something like encryption between
    proxies, and skipping the whole client->proxy->server->proxy->client
    chain if two users that want to talk to each other are on the same
    proxy, it can just go client1->proxy->client2.

            Now that I explained the featureset i will be working towards, I have
    spent a lot of hours on the implmentation and didn't come up with too
    much. Basically, since I want to support more protocols with time, I am
    dividing the framework in layers. How I originally thought of it is as
    follows: Have a data structure for each type of message (server
    notification, instant message, server response, user info, contact list,
    contact list user, etc).
            The bottom layer will handle actul transmittal of data, with each
    string of bytes it receives, it passes it to the protocol handler, but
    that won't work since the info on length is protocol specific (for aim,
    it's in the first 6 bytes) and i don't want to have a 'max buffer'. In
    general, i wanted the protocol handler to parse the data, fill the
    appropriate generic structures, fill a list that explains them, parse
    them with the generic layer, then use the same protocol handler to
    compose them back into protocol-specific data and send to server, but
    then the implementation of that, im iffy about to.
            If anyone has done anything like this before in C and under UNIX or
    just thinks they have a good idea on how to accomplish this, or just has
    some input on whether or not you think it's a terrible idea, let me
    know, even though i still want to implement it, for practice or whatnot
    (which is the main reason i am taking this up). Im posting this to
    collect general opinions and framework implementation recomendations.
            I have a fairly good grasp of C and UNIX-way of doing things. Thanks
    for reading, and thanks in advance.

                    -Yan


  • Next message: Bryan Hoover: "Re: If I'm not a programmer, then what am I? ;)"

    Relevant Pages

    • Advice on writing an instant messaging proxy
      ... the next time the user connects to the proxy. ... disconnection to the AIM (or whatever other chat protocol) server, ... client to server as if client was always connected, ...
      (comp.unix.programmer)
    • Re: how can i implement proxyservers in c#.net
      ... > target server and client machine. ... > Please help me the structure of the proxyserver for HTTP protocol? ... >> It would help to know what protocol you are wanting to create a proxy ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: how can i implement proxyservers in c#.net
      ... It would help to know what protocol you are wanting to create a proxy for. ... A very abstract database (SQL Server, MySQL, ... a proxy for some of them (HTTP). ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: ssh listen on port 80
      ... Probably not with a web proxy in the way. ... The role of a proxy is to *understand* the protocol, ... client from it cache if there is no difference, ... Is the win2k3 "server" a dual homed bastion host that you have to go ...
      (comp.unix.bsd.openbsd.misc)
    • Re: ISA Server Problems, please help
      ... Based on the rules you have listed, SecureNAT clients should only be allowed ... The All access rule for SBS Internet Users ... Web Proxy and/or Firewall Client ... > header to the publishing server instead of the actual one. ...
      (microsoft.public.windows.server.sbs)