Get magnets working

Arne Babenhauserheide <[email protected]> Tue, 5 Aug 2008 17:07:55 +0200
Newsgroups gmane.network.gnutella.devel
Message-ID <[email protected]>
Am Dienstag 05 August 2008 13:56:11 schrieb [email protected]:
> Magnets are waiting for us.
>
> And once we have working magnets, who will need torrents? :-)

Except for "they are already published stuff" and "there are millions of 
torrents on the web, mostly organized by cathegory, checked and commented", I 
fully agree. 

Did you check the freebase script? Kickstarting magnets via a fixed location, 
so we get the first hosts through which we can enter the download mesh. 

- http://www.freebase.be/g2cache.php

Phex uses freebase for the decentral update, and that could be done easily for 
any other file (I already used it in many magnets). 

Sure, it is non-anonymous and not decentral (in the sense that the 
kickstarting gets done from a server), but the same is true for every torrent 
server and also for the standard download mesh. 

And different from a torrent server, kickstarting the download mesh from a 
server can be made fully compatible with standard webdownloads: 

- If someone connects with a browser, the browser will just ignore the alt-loc 
headers. Either the server will then reply "range not avaible" (if it doesn't 
host the file), or it will just serve the file. 

- If someone connects with a Download Mesh enhanced client, the client will 
parse the alt-locs and download the file decentrally. 

= About freebase = 

I just tested it a bit, and for a Firefox download it answers with: 

"""
302 Found Date: Tue, 05 Aug 2008 14:45:49 GMT
Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e 
mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Location: 
http://www.freebase.be/g2/dlcount.php?sha1=7NV63BRV74DOO3H54MTORXCXO22O7W3G
Vary: Accept-Encoding
Content-Length: 259
Content-Type: text/html; charset=iso-8859-1
"""

And a check on the long location gives: 
"""
Date: Tue, 05 Aug 2008 14:48:17 GMT
Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 
mod_gzip/1.3.26.1a PHP/4.4.8 mod_ssl/2.8.22 OpenSSL/0.9.7e
Accept-Ranges: bytes
Alt-Location:
Connection: close
Remote-IP: 217.227.81.46
X-Alt:
X-Available-Ranges: bytes 0-0
X-Content-URN: urn:sha1:7NV63BRV74DOO3H54MTORXCXO22O7W3G
X-Nick: Freebase source provider
X-Powered-By: PHP/5.2.6
X-SourceProvider: true
Transfer-Encoding: chunked
Content-Type: application/x-msdownload
"""

(checked via the python httplib: 
------ ------ ------ full Python code ------ ------ ------ 
conn = httplib.HTTPConnection("cache.freebase.be")
conn.request("GET", "/7NV63BRV74DOO3H54MTORXCXO22O7W3G")
r1 = conn.getresponse()
print r1.msg # this returns the first set of headers

conn2 = httplib.HTTPConnection("www.freebase.be")
conn2.request("GET", "/g2/dlcount.php?sha1=7NV63BRV74DOO3H54MTORXCXO22O7W3G")
r2 = conn2.getresponse()
print r2.msg # this returns the second set of headers
------ ------ ------ /full Python code ------ ------ ------ 
)

And having an adaption of that script on every server would suffice to make 
every download on the internet Gnutella enabled by simply calculating the 
sha1 for every file (once) and providing some extra headers. 

It would be easily possible to reply with the file data instead of a 404 after 
all. 

Anyone interested in writing an Apache module? 

Best wishes, 
Arne

-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the 
history of free software. 
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln. 

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt


[Non-text portions of this message have been removed]