AfterDawn: Tech news

TinyP2P, the world's smallest P2P application

Written by James Delahunty @ 06 Jan 2005 9:04

Consisting of just 16 lines of Python code, the worlds smallest P2P application, TinyP2P, was written by Ed Felten, with help from Alex Halderman. Edward W. Felten is a Professor at Princeton University and Alex Halderman is a PhD student in computer science at Princeton University. It was written to prove how easy it is to write a P2P application, and it has shown that any programmer with moderate skills could come up with their own P2P application. For this reason, both men believe that it's near possible to regulate P2P and/or to ban it completely.
The program creates a small-world network, which might be used by a group of friends or business associates to share files. The program does not work well for very large networks; instead, many small networks can coexist. Each network is protected by a password; a network can be accessed only by people who know its password. (But networks are not secure against attackers who can eavesdrop on their traffic.) The program uses the HTTP and XML-RPC communication protocols. The program can be run in either server or client mode. To run it as a server you would have to type the command:



python tinyp2p.py password server hostname portnum [otherurl]

Here password is the password for the network, hostname and portnum will be used to construct the URL on which the server will listen (http://hostname:portnum), and otherurl (which is optional) is the URL of another server that is already running as part of the network. (Otherurl will be used to hook up your server to the network. If you don't provide an otherurl, the program will assume that your server is starting a new network.) When run as a server, the program connects to a network of other servers, and makes all of the files in the current directory available for downloading by users of the network. To run the program in client mode you would type the command:

python tinyp2p.py password client serverurl pattern

Here password is the network's password, serverurl is the URL of a server that belongs to the network, and pattern is a character string. This command looks at every file being shared by every server on the network. A file is downloaded, and stored in the current directory, if two things are true: (a) the file's name contains the substring pattern, and (b) there is not already a file of the same name in the current directory.

The TinyP2P code can be downloaded here.

Source:
Freedom-to-tinker.com

Previous Next  
Comments have been disabled for this article.

Latest news

Roomba Combo j7+ review - Clever trick allows robot vacuum finally to tackle home with rugs and carpets Roomba Combo j7+ review - Clever trick allows robot vacuum finally to tackle home with rugs and carpets (06 Jun 2023 9:19)
Roomba Combo j7+ is the very first Roomba model to combine robot vacuum with mopping features. And Roomba Combo j7+ does all that with a very clever trick, which tackles the problem with mopping and carpets. But is it any good? We found out.
Neato, the robot vacuum company, ends its operations Neato, the robot vacuum company, ends its operations (02 May 2023 3:38)
Neato Robotics has ceased its operations. American robot vacuum pioneer founded in 2005 has finally called it quits and company will cease its operations and sales. Only a skeleton crew will remain who will keep the servers running until 2028.
5 user comments
How to Send Messages to Yourself on WhatsApp How to Send Messages to Yourself on WhatsApp (20 Mar 2023 1:25)
The world's most popular messaging platform, Meta-owned WhatsApp has enabled sending messages to yourself. While at first, this might seem like an odd feature, it can be very useful in a lot of situations. ....
18 user comments
How to Enable Bluetooth on Stadia Controller How to Enable Bluetooth on Stadia Controller (11 Feb 2023 1:04)
Google shut down its streaming game service Stadia late last month and this means that some people have Stadia controllers lying around that seem to be of no use. That is fortunately not the ....
2 user comments
Guide: How to Kick Unwanted Guests from Your Netflix Account Guide: How to Kick Unwanted Guests from Your Netflix Account (26 Jan 2023 2:14)
Sharing a Netflix account with a person in a different location is possible and indeed very common, although the company doesn't necessarily enjoy this behavior from their customers. However, ....

News archive