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.


  1. This doesn’t work anymore :( At least, on my Intel Mac 10.5.6.

    Can you update this to make it work on Intel Mac?

    Comment by Zedeck — 2009-05-20 @ 21:20

  2. I have an Intel Mac, too, so that’s not the problem. I’m still on 10.4 and don’t intend to upgrade, so there’s nothing I can do about it, sorry.

    Comment by thomas11 — 2009-05-22 @ 14:08

  3. I got this working on OSX 10.5.7. This post got me most of the way there (thanks for the post!) but needed some tweaks. Here’s what I recall that I did to get it to work:

    (1) In the instructions above, the line “glibtool gcc -o tconn.o -c tconn.c” should be changed to “glibtool –tag=CC gcc -o tconn.o -c tconn.c”

    (2) In the Makefile, find the line “cp -f $(HOME)/.tconn/” and change it to “cp -f tconn.dylib $(HOME)/.tconn/”. In fact you might want to change all occurrences of “” to “tconn.dylib” in the entire Makefile.

    (3) In the Makefile, change “- cp -f $(HOME)/.tconn/tconn.conf ${HOME}/.tconn/tconn.conf.bak” to “cp -f $(HOME)/.tconn/tconn.conf ${HOME}/.tconn/tconn.conf.bak”

    (4) In the Makefile, change all instances of “$(HOME)” with “${HOME}”. You may not have to do this if you’re using tcsh/csh as your shell. I’m using bash and this worked for me.

    Finally, it may not be obvious to some users but you have to run networking commands that will use transconnect in the same shell that you ran the “export” command in the instructions above. I know its obvious to a lot of readers but probably the number one mistake novices might make.

    Comment by Ishan — 2009-06-17 @ 19:03

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Blog at

%d bloggers like this: