Want to show your appreciation? Please to my charity.

Monday, October 12, 2009

MLDonkey Internet Explorer Integration

I have recently setup a home NAS, D-Link DNS-323, and setup MLDonkey to run P2P. It worked great except two problems.

a) it uses a lot of RAM so my poor NAS is running at 1.5M free. DNS-323 only has 64M total. The NAS is still serving other functionality fine so I’m leaving the RAM issue aside for now.

b) I cannot find a decent browser integration solution for Internet Explorer.  But I need to get IE integration working because my other family members, who actually use the P2P most, are still mainly IE users. So here we start.

I started by searching the Google for an existing solution. There is a wiki page about Browser Integration for MLDonkey has comprehensive information but the integration solution for IE is described in only one line.


This is the first one I tried as it is the only IE solution listed on the wiki. It manually adds an protocol handler by editing registry. The handler actually reforms the URL then uses IE again open the reformed URL with original ed2k URL as the request parameter. It doesn’t work for two reasons:

  1. Username, password handing. Author use http://username:passwod@site:port/ URL to encode authentication information. Somehow it doesn’t work, It may worked before but IE7 and 8 that I have tried. It gave me unknown site error.
  2. Because it passes ed2k URL as is in the parameter, many special characters are not handled properly. So even after I removed the authentication information (I manually entered when IE prompted me later) the MLDonkey core gets a garbled link and errors out.


I installed Sancho, this is a must have for MLDonkey IMHO. It gives a full GUI for MLDonkey Core running on any machine, local or remote. It’s quite small and fast; It’s very useful to submit bittorrent files and check status. The piece of information missing from the wiki page is that Sancho also support protocol association (Search “Input links” in FAQ). In Vista, you’ll need to run it as administrator for it to successfully update the registry, otherwise you get no error but nothing happens too.

So now what’s the problem with Sancho? Actually, it is not the Sancho’s problem, but rather, as always, the broken Internet Explorer when it handles international characters. If an URL contains non-ascii characters and encoded, instead passing it as is to the protocol handler, IE decodes it. It would be fine if it decoded correctly, but unfortunately no, it’s URL decoding logic is completely broken all the way up to IE8.


Now I reached the dead end on this. OK, if I cannot find one, I’ll write one. Hence born the DonkeyInput. It’s a tiny (21K) windows application written in C#.


DonkeyInput can be downloaded here, it needs no installation. The first run of the program will automatically register itself as ed2k protocol handler, you must run it as administrator on Vista for the first time to allow it successfully change the registry.

Now, restart your browser and click on an ed2k link. The windows above should pop up. All you need to do is set the correct options and click OK button.


  1. be a little patient if you are adding multiple URLs
  2. be a little patient after you click on OK button for it the send the request to MLDonkey Core.

1 comment:

Anonymous said...

So, what about info on how to reverse this?

It would be useful to know how to disable or remove this piece of code.


Post a Comment