viernes, 5 de octubre de 2012

ShareIt! working over DataChannel-polyfill

I could be able to finish it two days ago (after an entire week -and weekend- going to sleep after 3:00 AM :-P) but I have been busy this two days with university. Anyway, I have finished to debug the code and now ShareIt! is using DataChannel-polyfill to do the communications between the peers. Also, I needed to develop an IndexedDB polyfill to by-pass the Chrome bug related to storing Blob objects, so there's no persistence but I could be able to continue with the experiments :-)

The only drawback I have seen is that communications were really slow (about 25-30 seconds just for a 500KB image) until I got on the fact i have a 10Mbps/1Mbps ADSL line, so I tested it using a DataChannel-polyfill backend server on localhost and it downloaded in just 2 seconds, so maybe it was a problem with my limited line upload. The good part is that for the tests i used Chrome SpeedTracer and didn't look any unusual (except comunication peaks were about each 5 seconds), so the app is very responsible :-) Also i have developed the code on a library way, so it could be exported to other projects (althought previously it needs some documentation and port the original, simple interface to it as a proof-of-concept).

Finally, you can test it (currently only on Chrome, DataChannel-polyfill is giving me problems on Firefox) at http://shareit.piranna.5apps.com, running against a handshake server and a datachannel backend server that I have hosted on two Nodejitsu testing sandboxes.

And obviously, you can get the code on GitHub :-D Things were I would need some help from now are related with the Kademlia implementation for searches (I was thinking about using KadOH), and file hashes where I would like to use Tiger TTH, but currently there's no JavaScript implementation. Another point I have been thinking about this days is just use the SDP IDs to do the handshake directly over the DataChannels, so there will be no need to use handshake or backend servers at all, but this need some investigation (a friend of mine told me that SDP IDs would expire in a few minutes so I can't be able to have a PeerConnection object ready to accept incoming connections just to do the handshake, any clue about this?).

And this is all for now. As usual, any comments or suggestions are welcome :-)