FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Is BitTorrent client in PHP be a cool idea???





manav
I have a question...

making a BT Client in possible but will it be of any help...

Should I try to go ahead and develop one???
MrBlueSky
It's virtually impossible to use a 'normal' PHP program running on a webserver as torrent-client. The script would have to run the entire time you are downloading, so you can't use the normal procedure of requesting a page and having PHP process the request and returning some response. You will have to write a PHP program which has to be run by the PHP interpreter directly without intervention of a server. This means you can't create something like a nice graphical user interface. Also you will have to manage a lot of concurrent connections using the bittorrent protocol, which will be a lot of work and coding. Have a look at the specification to see how it works: http://www.bittorrent.org/protocol.html
kansloos
I have no idea wether this is possible or practical, but currently you can run Azureus + WebUI plugin. To have a remotely controlable Bittorrent Client.

I use a simaler setup at home, but I run no gui so Azureus is set to run in text-mode.
But it works perfectly though, the only downside is that Azureus is written in Java which is rather slow and the error messages from the java interpreter on a crash are not exactly human readable, which makes debugging hard
AftershockVibe
Not only is it possible but it already exists. Well... sort of.
The PHP doesn't actually do the downloading, it's just an interface. As people have said, PHP is not designed for that sort of thing.

For example, TorrentFlux:
http://torrentflux.net/
Stubru Freak
You'd have to download the whole thing to your server first, upload something in return, then upload the resulting file to the client.
That's a lot of bandwidth.
kansloos
Stubru Freak wrote:
You'd have to download the whole thing to your server first, upload something in return, then upload the resulting file to the client.
That's a lot of bandwidth.


True, but if you have like me a computer that is mostly being used as a test server for homewritten code. A Bittorrent client accesable from the network is a quite useful thing to fill up the gigant amount of free space. Plus it uses a lot less energy as my high powered Intel Core 2 Duo with X1950XT.
Agent ME
Downloading a torrent through a server and then to the client defeats the whole purpose of the torrent system. You might as well download the file straight to the server, and then clients will be able to download it faster and you'll save a lot of bandwidth.
rohan2kool
possible... yes.
useful.. not really. because i doubt how many non-developers have the php runtime installed on the system. A BT client can be used by servers to download torrent files and mirror them, for ex. you download a Linux distro.. but that could be done better via utorrent or any other specialised torrent client as it is supposed to run on one server itself.
sanyo
I don't mean to re-open the subject, but is a torrent client allowed here, as they are mostly illegal?
MrBlueSky
sanyo wrote:
I don't mean to re-open the subject, but is a torrent client allowed here, as they are mostly illegal?


It's not really an issue. It is almost impossible to create a PHP torrent client. And if you would like to create a PHP interface for downloading torrents, like AftershockVibe mentioned, you can't use it on frihost. It's just an user interface: such a PHP program (like http://torrentflux.net/) still needs a real bittorrent client to do the actual downloading. Since you can't install arbitrary binary applications like torrent clients on frihost there is no way to run a torrentclient on your frihost account.

As for begin legal: I think torrent clients are not illegal. Of course they can be used for illegal downloading, but so can FTP or any other net-protocol. On the other hand I don't think you will be allowed to host a collection of torrents-trackers at frihost.
manav
what torrents are illegal where....???

microsoft is workin on its own p2p....

Avalanche is its name...

if they were illegal then why will microsoft invest it research funds on it????
swizzy
such php scripts exist in large numbers, all of them are banned on frihost Sad
they fall under the category of daemons

Quote:
what torrents are illegal where....???


torrents arnt illegal, downloading copyrighted stuff via torrents is illegal

if you keep a torrent hash file of a illegaly accquired software, its 100% legal. however if you download the software via that hash..... Dancing cops behind u...
roboguyspacedude
it wouldn't be practical because you would have to have a scrip that would constantly refresh itself to send a file piece to another person who would in tunr have to run a script to download it. that would eat up unlimited amounts of bandwidth and it would be really slow. besides, its probably not even possible.
lukand
This is very good idea but this idea isn't legal because this is not in rule for exchange files
BlueVD
yes, you can make a bt client in PHP. and if you know your coding with php well, it's easy to. All you'd have to do is make it run in the background (in unix/linux it's easy). As to the point of it? There's none. Linux has text mode clients that can run as daemons (fork in the background). Windows has a few (one or two if I recall) that can be set up as services.
Both of these cases are just fine, and throw in a FTP server (filezilla for win, for *nix you can choose: pure-ftpd, proftpd, vsftpd, etc) and thus you could share the file with local clients. Or even better, make your own tracker and on a job climpletion of the bt client run a script that will make a torrent for the downloaded file and use your server as the tracker so once again, you can send the file with bt further on...
But codding a new client in php would be rather useless. Though please do it is you think you must, who knows, we'll see the rise of a new cross-platform BT client =]
Agent ME
It's not just pointless, it's stupid.

The whole purpose of a bittorrent is to take advantage of a peer-to-peer system of computers to transfer a file - if you use that to download it to a server and then have the client download it from the server - I shouldn't need to say why that's redundant.
MrBlueSky
BlueVD wrote:
yes, you can make a bt client in PHP. and if you know your coding with php well, it's easy to.


Well, since a bt client has to use multiple threads and PHP doesn't support multi-threading (as far as I know) I would not only say it's not easy, but it's even virtually impossible. Smile
swizzy
MrBlueSky wrote:
BlueVD wrote:
yes, you can make a bt client in PHP. and if you know your coding with php well, it's easy to.


Well, since a bt client has to use multiple threads and PHP doesn't support multi-threading (as far as I know) I would not only say it's not easy, but it's even virtually impossible. Smile



There ARE tons of bt clients out there, try doing a search on sourceforge and see the results you get,

PHP may/may not support multi-threading but what has that to do with multiple incoming/outgoing connections.
MrBlueSky
swizzy wrote:
MrBlueSky wrote:
BlueVD wrote:
yes, you can make a bt client in PHP. and if you know your coding with php well, it's easy to.


Well, since a bt client has to use multiple threads and PHP doesn't support multi-threading (as far as I know) I would not only say it's not easy, but it's even virtually impossible. Smile



There ARE tons of bt clients out there, try doing a search on sourceforge and see the results you get,



Yes, but this thread is about bt clients in PHP. And there are no bt clients written in PHP. Because, as I said before, this is not possible in practice.

When you look at http://en.wikipedia.org/wiki/Comparison_of_BitTorrent_software there are mentioned two clients using PHP. Yet, even these two don't have their bt clients implemented in PHP. Torrentflux uses Python and Torrentvolve uses Java. Only their interfaces are implemented in PHP. It should be no surprise that both the Python and the Java implementation use the native thread support of those languages.

Quote:

PHP may/may not support multi-threading but what has that to do with multiple incoming/outgoing connections.


To put it simply: programs which handles multiple connections attach a separate process to each socket they open. These separate processes can be independent (Example: the Linux daemons model, or the old Apache 1 model), or they can run together in one namespace (in which case they are called threads. Apache 2 uses threads to handle multiple connections). Since you don't want your bt client to spawn multiple heavy weight processes you need thread-support, which PHP does not have. Hence: no PHP bt clients.
swizzy
MrBlueSky wrote:
programs which handles multiple connections attach a separate process to each socket they open. These separate processes can be independent (Example: the Linux daemons model, or the old Apache 1 model), or they can run together in one namespace (in which case they are called threads. Apache 2 uses threads to handle multiple connections). Since you don't want your bt client to spawn multiple heavy weight processes you need thread-support, which PHP does not have. Hence: no PHP bt clients.


hmmm... yea that does look convincing!

maybe its not possible to build a bt client in php... Crying or Very sad
sambhav
I hope ppl here have heard of PHP-GTK.

It would be a good idea to develop a client using GTK.
mahirharoon
but sever load will be at least 60%
and many people use it to host illegal stuff
so hosting them will result in
going to jail or being suspended
sambhav wrote:
I hope ppl here have heard of PHP-GTK.

It would be a good idea to develop a client using GTK.

but PHP-GTK is only used for offline programming
Related topics
P2P Puzzle
What do most of you do when you are online?
Forum Themes..
Link Lottery - free and fun
1st Post - My Ideas for a Language Site
I have made some banners for FriHost - Updated
My site.
Frihost Thread Of Records
Spore?
Website Idea....
COOL SEO SITE..WHAT DO YOU THINK?
Website Ideas
Guten Tag!
What do u like in OPERA ?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.