udpxy(1)

πŸ“¦
version 1.0.25.1 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– udpxy(1) β€” the udpxy manual page, bestie edition πŸ’–

okay so. sit down. grab a boba. we're talking about udpxy, and honestly? she's iconic. 🫢


✨ NAME ✨

udpxy β€” a UDP-to-HTTP multicast traffic relay daemon. that's the whole vibe. πŸ’…


🌈 SYNOPSIS 🌈

udpxy [-vTS] [-a <listenaddr>] [-m <mcast_ifc_addr>] [-c <clients>] [-l
<logfile>] [-B <sizeK>] [-R <msgs>] [-H <sec>] [-n <nice_incr>] [-M
<sec>] -p <port>

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so udpxy is a UDP-to-HTTP multicast traffic relay daemon. say it with me. she takes UDP traffic coming from a multicast subscription (or a source-specific multicast subscription, fancy) and forwards it straight to whatever HTTP client asked for it. a whole relay girly. ✨

she listens on a dedicated address/port, waiting for HTTP requests from clients. and a client request? it's gotta be structured like this, no exceptions:

http://{address}:{port}/{cmd}/[src_address@]{mgroup_address}{sep}{mgroup_port}

where:

  • {sep} β€” one of :|%|~|+|-|^
  • {cmd} β€” udp or rtp

and address + port have to match the listening address/port combo of udpxy, while mgroup_address:mgroup_port is what identifies the multicast group/channel to subscribe to. iykyk. πŸ‘‘

now the commands, bestie, pay attention:

  • udp β€” the udp command makes udpxy probe for known types of payload (stuff like MPEG-TS and RTP over MPEG-TS). she's investigating. πŸ”
  • rtp β€” the rtp command makes udpxy assume RTP over MPEG-TS payload, which means she skips the probes entirely. no questions asked, we trust. πŸ’…

udpxy will spin up a separate client process for each new relay request (as long as she's still within the specified limit on active clients). that client process relays/forwards all the network traffic it receives (via a UDP socket) from the specified multicast group over to the requesting HTTP connection. main character energy fr fr. πŸ”₯

she also supports a couple of administrative requests, because of course she does:


🌸 EXAMPLES 🌸

here's what it actually looks like in the wild:

http://192.168.0.12:5056/udp/10.170.185.82@232.22.137.57:5057
http://192.168.0.12:5056/udp/224.0.2.26:24012
http://192.168.0.12:5056/rtp/224.0.2.26:24012
http://192.168.0.15:5056/rtp/224.0.2.26^24055
http://192.168.0.15:5056/status/

see how the ^ is doing her little separator moment in there? slay. πŸŽ€


πŸ’… OPTIONS πŸ’…

udpxy accepts the following options, and yes we're going through every single one:

  • -v β€” enable verbose output [default = disabled]. she's yapping, on purpose.
  • -S β€” enable client statistics [default = disabled].
  • -T β€” do NOT run as a daemon [default = daemon if root]. read that again. capital T. it's a negation. πŸ™ˆ
  • -a <listenaddr> β€” IPv4 address/interface to listen on [default = 0.0.0.0].
  • -m <mcast_ifc_addr> β€” IPv4 address/interface of the (multicast) source [default = 0.0.0.0].
  • -c <clients> β€” maximum number of clients to accept [default = 3, max = 5000].
  • -l <logfile> β€” log output to file [default = stderr].
  • -B <sizeK> β€” buffer size (65536, 32Kb, 1Mb) for inbound (multicast) data [default = 2048 bytes].
  • -R <msgs> β€” maximum number of messages to buffer (-1 = all) [default = 1].
  • -H <sec> β€” maximum time (in seconds) to hold data in a buffer (-1 = unlimited) [default = 1].
  • -n <nice_incr> β€” nice value increment [default = 0].
  • -M <sec> β€” renew multicast subscription every M seconds (skip if 0) [default = 0].
  • -p <port> β€” port to listen on. this one's required, no cap. ⭐

🧚 PAYLOAD TYPES AND HANDLING 🧚

udpxy recognizes MPEG-TS and RTP over MPEG-TS payloads inside relayed packets. and if she bumps into RTP payload? she automatically 'translates' it to MPEG-TS by stripping the RTP headers β€” so media players that don't recognize RTP can still play the stream back. she's a translator. a linguist. a diplomat. πŸ’œ

so far, no translation is performed for other payload types. that's it. that's the whole story. 😭


🌈 RECORDING MPEG TRAFFIC 🌈

udpxy also has functionality to record captured traffic as a raw MPEG-TS stream into a file. this is enabled through udpxrec: a bundled-in application that's linked together with udpxy as one executable. ✨

udpxrec is invoked via a symbolic link (named udpxrec) pointing to the udpxy executable. and listen β€” do not rename the udpxy executable. just don't. πŸ™…β™€οΈ

⚠️ important bestie warning: udpxrec creates MPEG files encapsulating MPEG-TS segments, and certain media players will NOT play such files. to make them playable, the stream must be transcoded to MPEG-PS. vlc 'knows' how to do that transcoding β€” here's a command-line example:
vlc input-ts.mpg --sout="#std{access=file,mux=ps,dst=out-ps.mpg}"

the resulting MPEG-PS file can be played back by most media players. problem solved, we love a glow-up. πŸ¦‹


πŸ’œ ENVIRONMENT πŸ’œ

udpxy uses the following environment variables to compliment her command-line options β€” these are for the options most people wouldn't need to change too often (or that are just straight-up inconvenient to use from the command line). πŸ’…

NB: if there's a command-line switch that would intersect in functionality with an environment variable, the switch always has higher priority. always. she said what she said.
  • UDPXY_RCV_TMOUT β€” timeout (sec) on the inbound data stream (multicast), default=5;
  • UDPXY_DHOLD_TMOUT β€” timeout (sec) to hold buffered data before sending/flushing to client(s), default=1;
  • UDPXY_SREAD_TMOUT β€” timeout (sec) to read from the listening socked (handling HTTP requests), default=1;
  • UDPXY_SWRITE_TMOUT β€” timeout (sec) to write to the listening socked (handling HTTP requests), default=1;
  • UDPXY_SSEL_TMOUT β€” timeout (sec) to select(2) in server loop (unused if pselect(2) is employed), default=30;
  • UDPXY_LQ_BACKLOG β€” size of the listener socket's backlog, default=16;
  • UDPXY_SRV_RLWMARK β€” low watermaek on the receiving (m-cast) socket, default=0 (not set);
  • UDPXY_SSOCKBUF_NOSYNC β€” do not sync inbound (UDP) socket's buffer size (with the value set by -B), default=1 (sync);
  • UDPXY_DSOCKBUF_NOSYNC β€” do not sync outbound (TCP) socket's buffer size (with the value set by -B), default=1 (sync);
  • UDPXY_TCP_NODELAY β€” disable Nagle algorithm on the newly accepted socket (faster channel switching), default=1;
  • UDPXY_HTTP200_FTR_FILE β€” append contents of the given text file to the HTTP 200 response, default=none;
  • UDPXY_HTTP200_FTR_LN β€” append the text (line) to the HTTP 200 response, default=none;
  • UDPXY_ALLOW_PAUSES β€” if blocked on a write(2), keep reading data until the buffer (-B <sizeK>) is full, default=disabled;
  • UDPXY_PAUSE_MSEC β€” allow only N milliseconds of reading data when blocked on a write(2).
  • UDPXY_CONTENT_TYPE β€” specify custom Content-Type in HTTP responses.

πŸ‘‘ AUTHORS πŸ‘‘

Pavel V. Cherenkov and all the good people who submitted patches or otherwise contributed to the project. 🫢 legends, every single one.


πŸ”₯ SEE ALSO πŸ”₯

udpxrec(1)


okay that's the whole page bestie, you're officially educated, go forth and relay πŸŽ€

Version 1.0 β€” November 17, 2012 β€” from the udpxy(1) manual page. mwah. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from