.\" Stolen from groff's an-ext.tmac as of 2012-Mar-05 .nr mS 0 . . .\" Declare start of command synopsis. Sets up hanging indentation. .de SY . ie !\\n(mS \{\ . nh . nr mS 1 . nr mA \\n(.j . ad l . nr mI \\n(.i . \} . el \{\ . br . ns . \} . . nr mT \w'\fB\\$1\fP\ ' . HP \\n(mTu . B "\\$1" .. . . .\" End of command synopsis. Restores adjustment. .de YS . in \\n(mIu . ad \\n(mA . hy \\n(HY . nr mS 0 .. . . .\" Declare optional option. .de OP . ie \\n(.$-1 \ . RI "[\fB\\$1\fP" "\ \\$2" "]" . el \ . RB "[" "\\$1" "]" .. . . .\" Start example. .de EX . nr mE \\n(.f . nf . nh . ft CW .. . . .\" End example. .de EE . ft \\n(mE . fi . hy \\n(HY .. .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 -f fd .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 (or a specified file descriptor) 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 \fB-f\fR \fIfd\fR File descriptor ID. If this option is not set, stdin and stdout are closed and are connected to the socket, otherwise they are left intact, and the specified \fIfd\fR is used. .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 To do the same, but with stdin and stdout intact, using file descriptor 5 for communication: .EX ssh -L localhost:$PORT:localhost:$PORT $REMOTE_SERVER \\ vznnc -l -p $PORT -f 5 -- ploop copy -d $FILE -i5 -o5 .SH SEE ALSO .BR nc (3), .BR netcat (3), .BR socat (2). .SH LICENSE Copyright (C) 2014, Parallels, Inc. Licensed under GNU GPL v2.