Advice on writing an instant messaging proxy
From: Yan (rottled_at_gmail.com)
Date: 01/11/05
- Previous message: royad: "Re: If I'm not a programmer, then what am I? ;)"
- Next in thread: Barry Margolin: "Re: Advice on writing an instant messaging proxy"
- Reply: Barry Margolin: "Re: Advice on writing an instant messaging proxy"
- Reply: Bill Godfrey: "Re: Advice on writing an instant messaging proxy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: royad: "Re: If I'm not a programmer, then what am I? ;)"
- Next in thread: Barry Margolin: "Re: Advice on writing an instant messaging proxy"
- Reply: Barry Margolin: "Re: Advice on writing an instant messaging proxy"
- Reply: Bill Godfrey: "Re: Advice on writing an instant messaging proxy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|