kfei / docktorrent

:zap: Full-featured BitTorrent box runs in Docker
378 stars 65 forks source link

Add configuration to Nginx to support XMLRPC via scgi. #6

Closed jaysh closed 9 years ago

jaysh commented 9 years ago

Hi,

This PR adds support for XMLRPC. I've also moved the auth logic to the server block, so it protects the PHP files that would otherwise be exposed. I did some light testing of adding, stopping and removing a torrent and I don't believe this introduces any new issues.

Example usage:

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rtorrent
>>> client = rtorrent.RTorrent('http://docktorrent:p@ssw0rd@172.20.102.195/RPC2')
>>> client.get_torrents()
[<Torrent info_hash="B415C913643E5FF49FE37D304BBB5E6E11AD5101" name="ubuntu-14.10-desktop-amd64.iso">]
>>> 

Thanks, Jay

kfei commented 9 years ago

@jaysh Thanks a lot. It's really useful! :+1: