Fork me on GitHub

socketpipe dds

An RJ-45 plug coming out of a pipe

Socketpipe

Socketpipe connects over a TCP/IP socket a remote command specified to a local input generation command and/or a local output processing command. The input and output of the remote command are appropriately redirected so that the remote command's input will come from the local input generation command and the remote command's output will be sent to the local output processing command. The remote command is executed on the machine accessed through the login command. The socketpipe executable should be available through the execution path in the remote machine. The braces used for delimiting the commands and their arguments should be space-separated and can be nested. This feature allows you to setup complex and efficient topologies of distributed communicating processes.

Although the initial socketpipe communication setup is performed through client-server intermediaries such as ssh(1) or rsh(1), the communication channel that socketpipe establishes is a direct socket connection between the local and the remote commands. Without the use of socketpipe, when piping remote data through ssh(1) or rsh(1), each data block is read at the local end by the respective client, is sent to the remote daemon and written out again to the remote process. The use of socketpipe removes the inefficiency of the multiple data copies and context switches and can in some cases provide dramatic throughput improvements. On the other hand, the confidentiality and integrity of the data passing through socketpipe's data channel is not protected; socketpipe should therefore be used only within a confined LAN environment. (The authentication process uses the protocol of the underlying login program and is no more or less vulnerable than using the program in isolation; ssh(1) remains secure, rsh(1) continues to be insecure.)

Examples

socketpipe -i { tar cf - / } -l { ssh remotehost } -r { dd of=/dev/st0 bs=32k }
Backup the local host on a tape drive located on remotehost.
socketpipe -l { ssh remotehost } -r { dd if=/dev/st0 bs=32k } -o { tar xpf - /home/luser }
Restore a directory using the tape drive on the remote host.
socketpipe -i { tar cf - / } -l { ssh remotehost } -r { bzip2 -c } -o { dd of=/dev/st0 bs=32k }
Backup the local disk on a local tape, compressing the data on the (presumably a lot more powerful) remotehost.

Download

The current socketpipe version is 1.10. The following pages do not contain navigation links. Following a link will open a new browser window.

Documentation

Source Code Repository

The socketpipe source code repository is available on GitHub. You can clone it by running the following command.
git clone git@github.com:dspinellis/socketpipe.git
Diomidis Spinellis home page

(C) Copyright 2003-2015 D. Spinellis. May be freely uploaded by WWW viewers and similar programs. All other rights reserved.