FAUCET

Section: User Commands (1)
Updated: Mar 30 1992
Index Return to Main Contents
 

NAME

faucet - a fixture for a BSD network pipe  

SYNOPSIS

faucet port command (in|out|err) [once] [verbose] [quiet] [unix] [foreignhost host] [foreignport port]

 

DESCRIPTION

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

tar -cf - . | rsh other "cd destdir; tar -xf -"

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.

 

EXAMPLES

This creates a TCP-IP socket on the local machine bound to port 3000.

example% faucet 3000 "tar -cf - ." out verbose

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

/bin/csh -c "tar -cf - ."

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

example% faucet u-socket "dd if=angio.pgm" out err once

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.

 

SEE ALSO

hose(1), socket(2), bind(2), listen(2), accept(2), services(5), gethostbyaddr(3)

 

NOTES

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.

 

COPYRIGHT

Copyright (C) 1992 Robert Forsman

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.

 

AUTHOR


 Robert Forsman
 thoth@lightning.cis.ufl.edu
 University of Florida
 Department of Computer and Information Science


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
SEE ALSO
NOTES
COPYRIGHT
AUTHOR

This document was created by man2html, using the manual pages.
Time: 21:51:16 GMT, February 02, 2023