faucet attempts to provide the functionality of pipes over the network. It behaves as the server end of a server-client connection. When used with hose(1) it can function as a replacement for
faucet and hose are especially useful when you don't have easy access to the destination machine.
faucet creates a BSD socket, binds it to the port specified on the command line, and listens for connections. Every time faucet gets a connection it forks the command with stdin, stdout, and/or stderr redirected according to the in out err flags. If the once flag is specified, faucet will exec(2) the command instead of fork(2)ing and exec(2)ing. once means that the network pipe is only good for one shot. The verbose flag specifies that faucet should print information about connecting hosts . This information includes the numeric host address, host names, and foreign port numbers. The quiet flag specifies that faucet should NOT print such info. quiet is the default. The unix flag specifies that the port is not an internet port number or service name, but instead it is a filename for a UNIX domain socket. The foreignhost option specifies that faucet should reject all connections that do not come from the host machine. Similarly foreignport specifies that faucet should reject all connections that are not bound on their local machine to the port argument. The above two options allow a crude form of authentication. Note that on most systems only root can bind a socket to a port number below 1024.
This creates a TCP-IP socket on the local machine bound to port 3000.
Every time some process (from any machine) attempts to connect to port 3000 on this machine the faucet program will fork(2) a process and the child will exec(2) a
The out option means that the output of the child process will have been redirected into the new socket retrieved by the accept(2) call. verbose means that faucet will print information about each new connection.
This creates a UNIX domain socket in the current directory
The out err option means that stdout and stderr will be redirected in the child process. The once option means that the faucet will not fork(2), but exec(2) the process so that only the first process can connect to the u-socket before the faucet becomes unavailable.
Doubtless there are bugs in this program, especially in the unix domain socket portions. I welcome problem reports and would like to make these programs as "clean" (no leftover files, sockets) as possible.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.