Peter Benie wrote a very nice socks proxying library that can be preloaded into dynamically linked executables to make them do all their (tcp) network connections via a socks proxy.
His page describing it is here.
I've bodged it into working under MacOS X. This page describes the relevant information
Update 01May2008 Improved patch that produces a dual architecture (i386/x86_64) socksproxy.so binary (so that both 32 bit and 64 bit executables will work with it).
I also have a page of hints/howtos for using it under linux.
First, download socksproxy.so onto your machine. Note the full path to its location, such as
Then, set up an openssh port forwarder:
ssh -2 -N -f email@example.com -D 1080[ Substituting your CUED account id for
The next section describes the simplest way of testing this out, but for best results, skip to the end of this page for a neater way of doing things
Now set your environment:
export DYLD_INSERT_LIBRARIES=/some/path/to/socksproxy.so export SOCKS_PROXY_NETWORK=188.8.131.52/16 export SOCKS_PROXY_USERNAME=userid
Any application you run from the shell that has that environment set should redirect tcp connections to any host in the CUED network via the openssh port forwarder.
Under MacOS X, you can set these environment variables for processes
that are started from a terminal, by putting the export commands in
˜/.bashrc file .
Unfortunately, it's more difficult to affect applications that are
launched from the desktop. The MacOS documentation claims that
environment variables can be set for all such applications by editing the
˜/.MacOSX/environment.plist file . However,
it appears that a security patch that came out in 1997 caused all
environment variables beginning DYLD_ to be ignored in this file.
Fortunately, there's a solution: the launchd (the process that is responsible, among other things, for running programs that are launched on the Mac desktop) can be asked by the launchctl utility to set an environment variable for everything it launches.
The following sequence of commands will have the desired effect
on all "launched" applications (including those started from a
terminal using the
launchctl setenv DYLD_INSERT_LIBRARIES /some/path/to/socksproxy.so launchctl setenv SOCKS_PROXY_NETWORK 184.108.40.206/16 launchctl setenv SOCKS_PROXY_USERNAME userid