EnglishFrenchSpanish

OnWorks favicon

hose - Online in the Cloud

Run hose in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command hose that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


hose - the client end of a BSD network pipe

netpipes 4.2

SYNOPSIS


hose hostname port (--in|--out|--err|--fd n|--slave|--netslave|--netslave1|--netslave2)
[--verbose] [--unix] [--localport port] [--localhost addr] [--retry n] [--delay n]
[--shutdown [r|w][a] ] [--noreuseaddr] [-[i][o][e][#3[,4[,5...]]][s][v][u]] [-p
local-port] [-h local-host] command args

DESCRIPTION


hose attempts to provide the functionality of pipes over the network. It behaves as the
client end of a server-client connection. When used with faucet(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 non-interactive access to
the destination machine.

OPTIONS


hose creates a BSD socket and, if the --localport option is used, binds it to the port
number (or service name) specified immediately afterwards. If --localhost is also
specified then its argument is a local address to bind to. ( --localhost is only useful on
machines with multiple IP addresses.)

hose then tries to connect to the foreign machine hostname with foreign port port.

If successful hose redirects the socket to stdin, stdout, stderr, and/or arbitrary file
descriptors according to the --in --out --err --fd n flags. hose also automagically shuts
down the unused half of the connection if only --in is specified or if only --out and/or
--err are specified. See the --shutdown option for more information.

hose then exec(2)s a command with args.

However, the --slave flag turns hose into a primitive sort of telnet. The command is
ignored. Instead, hose goes into a loop where it copies bytes from stdin to the socket,
and bytes from the socket to stdout. This is actually more useful than telnet because
telnet tries to perform interpretation on the byte stream and generally gets in your way.
hose just passes bytes without mucking with them.

The --netslave* options are variants on the --slave theme. Whereas --slave will continue
to forward data in one direction even after the other has encountered EOF, --netslave
variants are more aggressive in closing the entire socket. Before closing the socket, it
attempts to flush any data already in its own buffer. --slave performs the shutdown(2)
system call when it encounters EOF on one direction, but the --netslave variants don't
because some network daemons are confused by it.

--netslave closes down the connection when it encounters EOF in either direction.

--netslave1 closes down the connection when it encounters EOF while reading stdin. Any
data unread on the socket will be ignored. If it merely encounters EOF on the socket, it
will continue to read from stdin.

--netslave2 closes down the connection when it encounters EOF while reading from the
socket. Any data unread on stdin will be ignored. If it merely encounters EOF on stdin,
it will continue to read from the socket. This mode can be useful with some web servers.

The --verbose flag specifies that hose should print information about the host it connects
to. This information includes the numeric host address, host names, and foreign port
numbers.

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. This option may be simulated by
using -unix- as the host name to connect to, or by renaming the hose program to uhose.

--retry n allows the user to specify that hose should retry the connect(2) call for n
times (or forever if n is negative). --delay n specifies how many seconds to delay
between tries.

--shutdown is used to control two behaviors. The first set is controlled by the `r' and
`w' flags. If the `r' is present, then hose will close half the connection to make it a
read-only socket. If the child tries to write, it will fail. If the remote connection
tries to read, it will percieve the socket as closed. If instead the `w' is present, then
hose will close the other half of the connection to make it a write-only socket. If the
child tries to read, it will percieve the socket as closed. If the remote connection
tries to write, it will fail. The default behavior is to leave both halves open, however
the shutdown of half of the connection is automagically done by certain combinations of
the --in, --out, and --err flags. To suppress their automagic behavior you can use
(respectively) --fd 0, --fd 1, and --fd 2.

The other behavior is controlled by the `a' flag. If the `a' flag is present then hose
will fork(2) before execcing the command and when the child exits it will perform a
shutdown(2) with how=2. This closes both halves of the connection. This option is not
necessary for most applications since the closing of the file descriptors is detected by
the remote process, but some less sophisticated network devices (such as printers) require
a shutdown(2) for proper operation. To make things perfectly clear, the list of
acceptable arguments to the --shutdown option are `r', `w', `ra', `wa', `a'.

By default, hose performs a

which prevents the ``Address in use'' problem that ``plagued'' netpipes versions 4.0 and
earlier. --noreuseaddr tells hose to skip that system call, and revert to pre-4.1
behavior. Without this call, the port is not always available for immediate reuse after
the hose exits.

SHORT FLAGS


To reduce the typing requirements for arguments (and to pay homage to the age-old
tradition of UNIX cryptotaxonomy) I have added some short forms of the flags. Here is a
correspondence chart:

┌──────┬──────────────┐
│Short │ Long │
iin
oout
eerr
#nfdn
sslave
vverbose
qquiet
uunix
plocalport
hlocalhost
└──────┴──────────────┘
See faucet(1) for a more detailed discussion of short flags. Their behavior should be
unsurprising. The flags that require separate arguments follow in the tradition of
tar(1).

EXAMPLES


This will connect to port 3000 on the machine reef and connect the socket to the stdin of
a tar command.

example$ hose reef 3000 --in tar -xf - .

The command actually exec(2)ed by the hose program is

tar -xf - .

The --in option means that the input of the child process will have been redirected into
the socket connected to reef.

This connects to a UNIX domain socket in the current directory

example$ hose --unix- u-socket --in sh -c \
"unfunky.perl.script | dd of=sample.pgm"

The socket provides input to the sh command.

Use hose online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    movistartv
    movistartv
    Kodi Movistar+ TV es un ADDON para XBMC/
    Kodi que permite disponer de un
    decodificador de los servicios IPTV de
    Movistar integrado en uno de los
    mediacenters ma...
    Download movistartv
  • 2
    Code::Blocks
    Code::Blocks
    Code::Blocks is a free, open-source,
    cross-platform C, C++ and Fortran IDE
    built to meet the most demanding needs
    of its users. It is designed to be very
    extens...
    Download Code::Blocks
  • 3
    Amidst
    Amidst
    Amidst or Advanced Minecraft Interface
    and Data/Structure Tracking is a tool to
    display an overview of a Minecraft
    world, without actually creating it. It
    can ...
    Download Amidst
  • 4
    MSYS2
    MSYS2
    MSYS2 is a collection of tools and
    libraries providing you with an
    easy-to-use environment for building,
    installing and running native Windows
    software. It con...
    Download MSYS2
  • 5
    libjpeg-turbo
    libjpeg-turbo
    libjpeg-turbo is a JPEG image codec
    that uses SIMD instructions (MMX, SSE2,
    NEON, AltiVec) to accelerate baseline
    JPEG compression and decompression on
    x86, x8...
    Download libjpeg-turbo
  • 6
    Xtreme Download Manager
    Xtreme Download Manager
    The project has a new home now:
    https://xtremedownloadmanager.com/ For
    developers:
    https://github.com/subhra74/xdm Xtreme
    Download Manager is a powerful tool t...
    Download Xtreme Download Manager
  • More »

Linux commands

  • 1
    acl_grant
    acl_grant
    rsbac-admin - Rule Set Based Access
    Control DESCRIPTION: rsbac-admin is a
    set of tool used to manage systems using
    a Rule Set Based Access Control (RSBAC)
    kern...
    Run acl_grant
  • 2
    acl_group
    acl_group
    rsbac-admin - Rule Set Based Access
    Control DESCRIPTION: rsbac-admin is a
    set of tool used to manage systems using
    a Rule Set Based Access Control (RSBAC)
    kern...
    Run acl_group
  • 3
    coolmail
    coolmail
    coolmail - 3D animated mail notificaion
    utility ...
    Run coolmail
  • 4
    coop-computing-tools
    coop-computing-tools
    coop-computing-tools - share resources
    in a heterogeneous, and unreliable
    computing environment DESCRIPTION: The
    Cooperative Computing Tools (cctools)
    are a co...
    Run coop-computing-tools
  • 5
    g3dviewer
    g3dviewer
    g3dviewer - a program to display and
    inspect 3D models ...
    Run g3dviewer
  • 6
    g3tolj
    g3tolj
    g3tolj - converts a Group 3 fax file
    into a printable HP-PCL file ...
    Run g3tolj
  • More »

Ad