~kt/udprelay

d2bc44db656e310d264b5cc54649f587d45c5b84 — Katie Wolfe 5 months ago d3380e2
Hard-wrap scdoc files at 80 columns
2 files changed, 36 insertions(+), 8 deletions(-)

M udprelay.1.scd
M udprelay.7.scd
M udprelay.1.scd => udprelay.1.scd +15 -4
@@ 10,17 10,28 @@ udprelay \- server to relay UDP connections to connected peers.

# DESCRIPTION

udprelay accepts UDP connections on _port_ and relays all incoming data to every peer which it has received data from within a certain timeframe defined by the *-timeout* option. When it hasn't received a packet from a peer in that time, it quietly drops all internal state related to that peer and stops relaying packets to it until it receives a packet from it again.
udprelay accepts UDP connections on _port_ and relays all incoming data to every
peer which it has received data from within a certain timeframe defined by the
*-timeout* option. When it hasn't received a packet from a peer in that time, it
quietly drops all internal state related to that peer and stops relaying packets
to it until it receives a packet from it again.

udprelay also features an optional command protocol that allows for more advanced functionality such as channels. This protocol is documented in *udprelay*(7) and may be enabled by passing the *-protocol* flag.
udprelay also features an optional command protocol that allows for more
advanced functionality such as channels. This protocol is documented in
*udprelay*(7) and may be enabled by passing the *-protocol* flag.

# OPTIONS

*-protocol*
	Enables the udprelay command protocol. When enabled, packets beginning with the string *udprelay!* will not be relayed and will instead be handled by udprelay in accordance with the protocol defined in *udprelay*(7). When unset, all packets will always be relayed.
	Enables the udprelay command protocol. When enabled, packets beginning
	with the string *udprelay!* will not be relayed and will instead be
	handled by udprelay in accordance with the protocol defined in
	*udprelay*(7). When unset, all packets will always be relayed.

*-timeout* _duration_
	Set the amount of time to leave connections open without receiving any packets from a peer. _duration_ is a sequence of decimal numbers with unit suffixes, such as *10m*, *120s*, and *5m48s*.
	Set the amount of time to leave connections open without receiving any
	packets from a peer. _duration_ is a sequence of decimal numbers with
	unit suffixes, such as *10m*, *120s*, and *5m48s*.

*-version*
	Prints the version of udprelay to stdout and exits with a code of 0.

M udprelay.7.scd => udprelay.7.scd +21 -4
@@ 6,7 6,16 @@ udprelay \- protocol for additional functionality implemented by *udprelay*(1)

# COMMANDS

Packets beginning with the string _udprelay!_ are interpreted as commands and are not forwarded to other peers. Each commands has a _head_ and a _body_. The _head_ is a sequence of lowercase alphabetical characters identifying the command to be executed. The _body_ is information passed to the command. The _body_ may contain any characters, but any spacing characters (one of 0x09, 0x0A, 0x0B, 0x0C, 0x0D, or 0x20) at the beginning or end of the body will be trimmed and ignored. The _head_ and _body_ are separated by one of the aforementioned spacing characters. If the _body_ is empty, you may omit the space and only send the _head_. The following are examples of valid command calls:
Packets beginning with the string _udprelay!_ are interpreted as commands and
are not forwarded to other peers. Each commands has a _head_ and a _body_. The
_head_ is a sequence of lowercase alphabetical characters identifying the
command to be executed. The _body_ is information passed to the command. The
_body_ may contain any characters, but any spacing characters (one of 0x09,
0x0A, 0x0B, 0x0C, 0x0D, or 0x20) at the beginning or end of the body will be
trimmed and ignored. The _head_ and _body_ are separated by one of the
aforementioned spacing characters. If the _body_ is empty, you may omit the
space and only send the _head_. The following are examples of valid command
calls:

	udprelay!channel Example



@@ 14,15 23,23 @@ Packets beginning with the string _udprelay!_ are interpreted as commands and ar

	udprelay!echo Hello, world.

A packet starting with the string _udprelay!_ will never be relayed to other peers. If a call is made to a command that doesn't exist, it is ignored.
A packet starting with the string _udprelay!_ will never be relayed to other
peers. If a call is made to a command that doesn't exist, it is ignored.

## channel

The *channel* command switches the peer to a different channel identified by the first string of non-spacing-characters in the command's _body_. If the _body_ is empty, the peer is switched to the default unnamed channel. Peers will only receive and send messages sent by and to peers who have connected to the same channel. After switching the peer's channel, the server will send the command's packet back to its originator unchanged.
The *channel* command switches the peer to a different channel identified by the
first string of non-spacing-characters in the command's _body_. If the _body_ is
empty, the peer is switched to the default unnamed channel. Peers will only
receive and send messages sent by and to peers who have connected to the same
channel. After switching the peer's channel, the server will send the command's
packet back to its originator unchanged.

## echo

Upon receiving an *echo* command, udprelay will resend the command's packet to its originator unchanged. Anything or nothing may be passed as arguments to this command; it will not interpret any of the remaining data in the packet.
Upon receiving an *echo* command, udprelay will resend the command's packet to
its originator unchanged. Anything or nothing may be passed as arguments to this
command; it will not interpret any of the remaining data in the packet.

# SEE ALSO