transconnect on Mac OS X

Filed under: tech — Tags: , — thomas11 @ 10:16

transconnect is a nifty utility allowing transparent TCP net access over a proxy, including authentication. In its current version 1.3-Beta on sourceforge, compiling on Mac OS X fails, however. Here’s how to build and use it on OS X 10.4:

  • Edit libcpath.h to define the correct libc:

#define TCONN_LIBC_PATH "/usr/lib/libc.dylib"
  • Introduce a new target “mac” (or whatever) in the Makefile, anywhere among the other targets:

mac: tconn.c
    glibtool gcc -o tconn.o -c tconn.c
    libtool -dynamic tconn.o -o tconn.dylib -ldl -lSystemStubs
  • That sould suffice for building it:

$ make mac
$ make install
  • Now set the environment variable. LD_PRELOAD, as given in the docs, is not correct for Mac OS. Replace it by DYLD_INSERT_LIBRARIES and also set DYLD_FORCE_FLAT_NAMESPACE:

$ export -p DYLD_INSERT_LIBRARIES="$HOME/.tconn/tconn.dylib"
  • Configure tconn.conf as usual.

I got virtually all necessary info from Thomas Strömberg’s Preloading shared libraries in Mac OS X.

Create a free website or blog at