unix2tcp 0.8.2

Unix2TCP is able to listen on a local UNIX socket and tunnel any incoming connections and traffic to a (remote) IP address/port.
  1 Screenshot
unix2tcp is a small program to redirect all connections and traffic from a UNIX socket to a (remote) TCP/IP address.

Example of usage: I have started this project to be able to transparently move my "local" MySQL servers to whatever location I want.

Having a web-hosting server with lots of client scripts that all connect to "localhost" (ie /tmp/mysql.sock) for talking MySQL is a problem when you want to move the MySQL server on its dedicated machine.

This is how we did it: we run unix2tcp /tmp/mysql.sock remoteip remoteport so that unix2tcp will listen to /tmp/mysql.sock and tunnel any traffic to remoteip:remoteport .

There we would have run any "normal" portforwarder to forward from "remoteport" to, thus beeing able to keep the grant tables in MySQL untouched (all connection would have seem to come from localhost).

I guess there can be other solutions to this problem too, but this way its the most flexible I have found yet. Another example ideea came from a user of this program. He wanted to remain anonymous so I will respect his wish.

He used unix2tcp to trick some X applications (binary release only) thinking that they are talking to the local X server but in fact they were talking to a remote X server were he forwarded the connections.

Main features:

  • tunnels all traffic between a (remote) address/port and a local UNIX socket
  • does NOT use fork() (single process model)
  • does use O_NONBLOCK , should be no case of blocking

last updated on:
September 21st, 2005, 14:49 GMT
license type:
GPL (GNU General Public License) 
developed by:
Mihai Rusu
ROOT \ System \ Networking
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!

Add your review!