Tag Archive for 'proxy'

My first code release: Conditional GET PHP function doConditionalGet()

I’ve started a section on this blog called “My Code” that features code I’ve written. My first release is doConditionalGet(), a generic PHP function that implements HTTP’s Conditional GET mechanism. This function facilitates making dynamic PHP pages cacheable by HTTP accelerators, browsers, or other caches. Read more about it here.

Suggestions, comments, criticisms are very much welcome!

If you liked this post, please subscribe to my feed. Thanks for visiting!

Tutorials: Make your PHP pages cacheable

The following tutorials taught me how to make PHP pages cacheable. If you do not manually set your PHP page’s HTTP headers, that page is generally uncacheable by browsers, reverse proxies, HTTP accelerators, etc. That might make sense for highly dynamic pages or personal/sensitive information, but there are plenty of situations where PHP generated content can and should be cached.

There is a typo in Ned Martin’s guide: “Last-Modified” is hyphenated! (Took me forever to figure out why I couldn’t set that header.)

Use the Cacheability Engine and the Live HTTP Headers extension for Firefox to debug as you go. Remember that shift-clicking reload/refresh forces the browser to fetch a fresh copy of the page.

Apologies for the short and sporadic posting. I’m busy hacking Zenphoto for another project. :)

P.S. Another plug for my host NearlyFreeSpeech.NET; Squid HTTP acceleration on shared hosting for mere pennies rocks! The availability of Squid made me look into HTTP caching for PHP pages.

Surfing anonymously with Tor and FoxyProxy is dead simple

Ever want to surf the web anonymously? Forget unreliable and sometimes illegal open proxies that are usually compromised or misconfigured servers. Forget web proxies that spam you with ad frames and pop-ups. Try Tor, an open-source anonymous peer-to-peer network. Using Tor and Firefox is extremely easy. More about Tor in this Wikipedia entry.

I tried the following steps in Arch Linux, but they should apply to any modern operating system. (By the way, Arch Linux is my favorite Linux distribution. I’ll likely write about it at some point.)

  • Install Tor using whatever appropriate package manager or installer. In Arch, I simply did “pacman -S tor“.
  • Windows users can get the installer.

  • Start Tor. In Arch, I did “/etc/rc.d/tor start“.
  • Install FoxyProxy for Firefox.
  • On first run, FoxyProxy will ask you some questions about Tor. Say you want to configure for Tor. Say you are running Tor without Privoxy (unless you know otherwise). Accept the default port for Tor. Voila.
  • Configure FoxProxy to use Tor for specific websites, or chose the “mode” where Tor is used for all websites. Make sure Tor is running.
  • Surf like a ninja. :)

To verify if your browser connections are anonymized by Tor, visit TorCheck. You can also visit any of the many sites which show you your IP address. If Tor is working, the IP address shown should be different from yours.

Windows users who need an even simpler method of using Tor should check out the XeroBank (xB) Browser. Read more about it at Wikipedia.

Be warned, don’t use Tor to do anything illegal. Tor has known weaknesses and does not guarantee your anonymity if someone wants to catch you badly enough.

If you’re interested in helping the Tor network grow, consider running a Tor relay.