Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok programmers, here's one for you.

I'm writing an open source IM client/protocol as a learning exercise and to scratch my itch about some problems with current protocols.

However, I'm poor. I do run a server but off the back of my own low-bandwidth residential connection (which I would rather -not- saturate by running an IM server on it).

I was thinking about the problem and looked into various alternatives (this was before I considered writing my own client/protocol) but there's nothing which doesn't require -any- server hardware.

The reason for this is fairly obvious, in order to keep contact lists persistent and synchronous, the simplest solution is to store them remotely and have the user download their contact list each time they log in.

One solution I did consider was storing the contact list information on USB flash drives but that is far from ideal (not least because I don't have one myself). Another option would be to implement a peer discovery network similar to bonjour, but that would not provide a contact list of your friends, just a contact list of everyone else who's online. More feasible than the USB idea, but the function isn't ideal in this case.

Does anybody have any other ideas for a serverless IM protocol?

share|improve this question

closed as primarily opinion-based by gnat, MichaelT, Robert Harvey, ChrisF Oct 9 '13 at 20:49

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

You could use web-based email API to access contact lists, such as Google Contacts Data API – Ed James Apr 4 '11 at 12:37
up vote 4 down vote accepted

Essentially you are talking about a P2P IM protocol (P2P = Peer to Peer). This provides a bunch of options for you, of varying usefulness.

  • Bonjour style peer discovery--and then use a distributed storage mechanism like BitTorrent. Assuming your friend list is small, you can dedicate a certain portion of your hard drive to storing snippets of peoples friend lists. NOTE: make sure the friend lists remain private.
  • Leverage existing services like Yahoo! Mail or GoogleMail to store the user's contact list.

Search around for what other P2P technologies are doing and see if that inspires you.

NOTE: a big challenge for you with a P2P solution is making it so that when two peers are online they are connected to each other. If I had a friend in Japan and I live in America, I'd like to pop open the chat and communicate with them if we happen to be online at the same time. Assuming the contact includes the connection point the IM protocol needs to make the connection, the contact will always be checked in addition to the ad hoc connections.

share|improve this answer
BitTorrent requires trackers, which are servers. – vartec Apr 4 '11 at 16:26
I didn't say use BitTorrent, but use a mechanism like it. Essentially, you build your peers using the Bonjour style discovery but transfer the bits like BitTorrent would. This replaces the tracker with your Bonjour style peer list. – Berin Loritsch Apr 4 '11 at 17:02
@vartec: sort of. Look up dhts. Also note that there can be (un)amusing issues with firewalls... – Paul Nathan Apr 4 '11 at 20:03
@Paul: DHT still require servers for peer discovery. – vartec Apr 4 '11 at 20:24
More or less what I suggested myself in my question, but helpful in that it confirms my suspicions that this problem is non-trivial. – Chris Browne Apr 4 '11 at 22:36

If you want a server try a free tier Amazon EC2 host, they are well free.

share|improve this answer
I looked into this a while ago, unfortunately I am telephonophobic and they require a telephone call to confirm identity. Sounds silly, but there you have it. – Chris Browne Apr 4 '11 at 19:53
You only need to enter a pin number, or get someone else to. – Thomas James Apr 5 '11 at 3:00
oh ok, thanks :) – Chris Browne Apr 5 '11 at 20:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.