Monday, March 26, 2007

socat on OS X 10.4.9

As it turns out, you can get socat 1.6.0.0 working in OS X 10.4.x.

I used this:

./configure --disable-ext2 --disable-tun --disable-libwrap --disable-readline


Do add -lresolv to the LIBS line in the resultant Makefile. Otherwise you will get a _res_9_init linking error.

I ran make like this (the -lresolv gets around a _append_history linking error):

CFLAGS="-L${prefix}/lib -lreadline -lresolv" make


That seemed to work, at least on the powerpc side. I've had no reason to try it on the intel side yet.

Thanks to what's left of darwinports for getting me started.

And FYI, the proper way to do port forwarding of http from an internal server to an external server with socat is this:


socat -d -d -lmlocal2 \
TCP4-LISTEN:80,bind=internalip,su=nobody,fork,range=10.0.0.0/8,reuseaddr \
TCP4:externalip:80


Drop that in a startup script, and you don't have to mess with natd or ipfw, especially useful when you don't want your configurations overwritten by OS X Server's GUI management tools.

No comments: