Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /usr/local/www/nat.guyton.net/geeklog-1.4.0sr2/public_html/lib-common.php on line 4396
Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /usr/local/www/nat.guyton.net/geeklog-1.4.0sr2/public_html/lib-common.php on line 4396
Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /usr/local/www/nat.guyton.net/geeklog-1.4.0sr2/public_html/lib-common.php on line 5531
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /usr/local/www/nat.guyton.net/geeklog-1.4.0sr2/public_html/lib-common.php on line 1143 Nat's Geeklog - My Own SOCKS-enabled Podcast Collector
Downloading podcasts... It's frowned upon at work (justifiably so), and many sites are blocked by our websense surfing monitor software. I am not saying that I do this, but purely for educational reasons, I wondered how I might download these files over an SSH tunnel? Read on for more...
To get around the websense for standard web browsing, I can ssh to an extnernal server (if you don't already have this, forget it), and with that I can either tunnel a connection with ssh's -L swich to a web proxy server there, or even better, use ssh's dynamic forwarding feature, acting as a SOCKS4 or SOCKS5 server. (see the ssh man page under the -D switch for more). This is neat because it doesn't require anything running on the external server - I just ssh to it with the switch -D 9999 and set localhost:9999 as my SOCKS4 server in the browser (firefox, of course), and I'm tunneled! Web traffic can go anywhere else... This is nice because you don't have to set anything up on the server you are connecting to. (Note that although I use UNIX ssh, these tunelling options are also possible on PuTTY, a popular Windows free ssh client.)
OK, that's fine for a browser with SOCKS4 client support built in. The problem was, I wanted a podcast fetching program that would take advantage of this same ssh/SOCKS connection. None of the programs I knew of (kpodder being the one I used at the risk of being websensed, again, for educational purposes only) supported socks. Being a programmer of sorts, I figured I would try to make one myself! Perl is my weapon of choice, and it has a nice Net::SOCKS module. Unfortunately, there is no nice and easy way that I know of to make perl's LWP library (web fetch stuff) work with Net::SOCKS, so I went the old fashioned route and sent the raw commands over the socket and simply took the return data. Works well enough, even for 26MB binary downloads!
At any rate, here are my perl scripts - one to handle generic socks communication and get http fetches (handles HTTP redirects, too), and one to manage my podcast list, downloaded history, and files, etc. It makes use of XML::Parser, which I am glad to have gotten some experience with (hey! educational!). This is currently hardcoded to an ssh process on localhost using the -D 9999 switch connecting to an external server, but that's easy enough to change in the first few lines.