phpABC

since I’ve been spending lots of time in a hotel, I decided it might be a good idea to startup a bittorrent project i’ve been thinking about for a while.

I want to improve upon the web/mobile torrent management interface that I pieced together a while back (which isn’t functioning anymore). I need a web service to start/stop/queue/resume/get status of torrents. The previous code I was using did this by using a modified btdownloadclient that wrote status information to a txt file. I started and stoped the processes using php. I just didn’t like the way it functioned so I decided to look into a better solution.

The ABC bittorrent client has a built in TCP server with a simple protocol for doing exactly what I want. Then I found phpABC which is a php web app that queries the TCP server and provides a nice web UI for managing torrents.

I really wanted to mess with this, but I have three problems

1) I don’t have a windows box at home to run ABC on
2) the windows lappy I’m using now is behind a NAT at the hotel so I can’t connect to the management server from the outside
3) I don’t have PHP running on the laptop so I can’t use phpABC locally

SSH to the rescue!

First, I installed phpABC on my linux box (with apache+php)

Next, I installed the ABC client on my laptop and started up the Web Management service on port 7000. I tested connecting to it locally by:
telnet localhost 7000

Finally, it’s time for the SSH fun. I need requests to localhost:7000 on my linux box to forward to port 7000 on my laptop (which is behind NAT). This can be done by setting up a reverse tunnel from the laptop (I’m using cygwin for ssh, btw):
ssh -R 7000:localhost:7000 user@mylinuxbox

Now, I test the tunnel by connecting to port 7000 from my linux box
mylinuxbox$ telnet localhost 7000

To complete the process, I go to the location where I installed phpABC and run through the config process. Everything is working great and I can now manage all my torrents from the browser.

now it’s time to write some code…this should be fun!

Leave a Reply