blob: 20b41f35c5ccc99ef714e78e3a81420bfb91f1cf [file] [log] [blame] [raw]
.TH vznnc 8 "29 May 2014" "OpenVZ" "Containers"
.SH NAME
vznnc \- run a program connected to a socket
.SH SYNOPSIS
.SY vznnc
{
.B -l
|
.B -c
}
.B -p
.I port
.OP --
.I program
[\fIarg\fR \fI...\fR]
.SH DESCRIPTION
This "nano-netcat" utility can be used to either listen on or connect to
a TCP port at localhost, and run a specified \fIprogram\fR with its stdin
and stdout connected to the socket.
.SH OPTIONS
.TP
.B -l
Listen on a specified TCP port at localhost.
.TP
.B -c
Connect to a specified TCP port at localhost.
.TP
\fB-p\fR \fIport\fR
Port number.
.TP
.B --
This is a separator between
.B vznnc
own arguments and
.I program
arguments, so that latter won't be processed by
.BR vznnc .
It is required in case there are any arguments to
.I program
that start with the dash
.RB ( - )
character, and is optional otherwise.
.TP
\fIprogram\fR [ \fIarg\fR \fI...\fR ]
Program to run, with optional arguments.
.SH EXIT STATUS
Returns \fIprogram\fR exit status upon success, or one of the following
codes in case of an error:
.IP 1
Invalid usage
.IP 127
Error executing \fIprogram\fR.
.IP 220
Network-related error.
.SH EXAMPLES
To run receiving side of
.B ploop copy
command on a remote server, using openssh port forwarding:
.EX
PORT=2345
ssh -L localhost:$PORT:localhost:$PORT $REMOTE_SERVER \\
vznnc -l -p $PORT -- ploop copy -d $FILE -i0 -o1
.EE
.SH SEE ALSO
.BR nc (3),
.BR netcat (3),
.BR socat (2).
.SH LICENSE
Copyright (C) 2014, Parallels, Inc. Licensed under GNU GPL v2.