1udpxy(1) udpxy manual page udpxy(1)
2
3
4
6 udpxy - a UDP-to-HTTP multicast traffic relay daemon.
7
8
10 udpxy [-vTS] [-a <listenaddr>] [-m <mcast_ifc_addr>] [-c <clients>] [-l
11 <logfile>] [-B <sizeK>] [-R <msgs>] [-H <sec>] [-n <nice_incr>] [-M
12 <sec>] -p <port>
13
14
16 udpxy is a UDP-to-HTTP multicast traffic relay daemon: it forwards UDP
17 traffic from a given multicast subscription to the requesting HTTP
18 client.
19
20 udpxy listens (on a dedicated address/port) for HTTP requests issued by
21 clients. A client request should be structured as:
22
23 http://{address}:{port}/{cmd}/{mgroup_address}[SEP]{mgroup_port}
24
25 [SEP] :|%|~|+|-|^
26
27 {cmd} udp|rtp
28
29
30 where address and port match the listening address/port combination of
31 udpxy, and mgroup_address:mgroup_port identify the multicast
32 group/channel to subscribe to.
33
34
35 udp udp command will have udpxy probe for known types of payload
36 (such as MPEG-TS and RTP over MPEG-TS);
37
38 rtp rtp command makes udpxy assume RTP over MPEG-TS payload, thus
39 skipping the probes.
40
41
42 udpxy will start a separate client process for each new relay request
43 (within the specified limit on active clients). The client process
44 will relay/forward all network traffic received (via a UDP socket) from
45 the specified multicast group to the requesting HTTP connection.
46
47
48 udpxy also supports a few administrative requests:
49
50
51 status http://address:port/status/ to send back an HTML page with dae‐
52 mon status and client statistics.
53
54 restart http://address:port/restart/ to close all active connections
55 and restart.
56
57
58
60 http://192.168.0.12:5056/udp/224.0.2.26:24012
61
62 http://192.168.0.12:5056/rtp/224.0.2.26:24012
63
64 http://192.168.0.15:5056/rtp/224.0.2.26^24055
65
66 http://192.168.0.15:5056/status/
67
68
70 udpxy accepts the following options:
71
72 -v Enable verbose output [default = disabled].
73
74 -S Enable client statistics [default = disabled].
75
76 -T Do NOT run as a daemon [default = daemon if root].
77
78 -a <listenaddr>
79 IPv4 address/interface to listen on [default = 0.0.0.0].
80
81 -m <mcast_ifc_addr>
82 IPv4 address/interface of (multicast) source [default =
83 0.0.0.0].
84
85 -c <clients>
86 Maximum number of clients to accept [default = 3, max = 5000].
87
88 -l <logfile>
89 Log output to file [default = stderr].
90
91 -B <sizeK>
92 Buffer size (65536, 32Kb, 1Mb) for inbound (multicast) data
93 [default = 2048 bytes].
94
95 -R <msgs>
96 Maximum number of messages to buffer (-1 = all) [default = 1].
97
98 -H <sec>
99 Maximum time (in seconds) to hold data in a buffer (-1 = unlim‐
100 ited) [default = 1].
101
102 -n <nice_incr>
103 Nice value increment [default = 0].
104
105 -M <sec>
106 Renew multicast subscription every M seconds (skip if 0)
107 [default = 0].
108
109 -p <port>
110 Port to listen on.
111
112
114 udpxy recognizes MPEG-TS and RTP over MPEG-TS payloads within relayed
115 packets; if udpxy encounters RTP payload it automatically 'translates'
116 it to MPEG-TS (by stripping RTP headers) so that media players not rec‐
117 ognizing RTP could still play back the stream.
118
119 So far, no translation is performed for other payload types.
120
121
123 udpxy includes functionality to record captured traffic as raw MPEG-TS
124 stream into a file. This functionality is enabled through udpxrec: a
125 bundled-in application that is linked together with udpxy (as one exe‐
126 cutable).
127
128 udpxrec is invoked via a symbolic link (named udpxrec) to the udpxy
129 executable (i.e. do not rename udpxy executable).
130
131 udpxrec creates MPEG files encapsulating MPEG-TS segments; certain
132 media players will NOT play such files; in order to make them playable
133 the stream must be transcoded to MPEG-PS; vlc 'knows' how to do such
134 transcoding, here is a command-line example:
135
136 vlc input-ts.mpg --sout="#std{access=file,mux=ps,dst=out-ps.mpg}"
137
138 The resulting MPEG-PS file can be played back by most media players.
139
140
141
143 udpxy utilizes the following environment variables to compliment its
144 command-line options; the variables are considered for the options that
145 most people would not need to change too often (or simply inconvenient
146 to use from the command line).
147
148 NB: If there is a command-line switch that would intersect in function‐
149 ality with an environment variable, the switch always has higher prior‐
150 ity.
151
152 UDPXY_RCV_TMOUT
153 timeout (sec) on the inbound data stream (multicast),
154 default=5;
155
156 UDPXY_DHOLD_TMOUT
157 timeout (sec) to hold buffered data before sending/flushing to
158 client(s), default=1;
159
160 UDPXY_SREAD_TMOUT
161 timeout (sec) to read from the listening socked (handling HTTP
162 requests), default=1;
163
164 UDPXY_SWRITE_TMOUT
165 timeout (sec) to write to the listening socked (handling HTTP
166 requests), default=1;
167
168 UDPXY_SSEL_TMOUT
169 timeout (sec) to select(2) in server loop (unused if pselect(2)
170 is employed), default=30;
171
172 UDPXY_LQ_BACKLOG
173 size of the listener socket's backlog, default=16;
174
175 UDPXY_SRV_RLWMARK
176 low watermaek on the receiving (m-cast) socket, default=0 (not
177 set);
178
179 UDPXY_SSOCKBUF_NOSYNC
180 do not sync inbound (UDP) socket's buffer size (with the value
181 set by -B), default=1 (sync);
182
183 UDPXY_DSOCKBUF_NOSYNC
184 do not sync outbound (TCP) socket's buffer size (with the value
185 set by -B), default=1 (sync);
186
187 UDPXY_TCP_NODELAY
188 disable Nagle algorithm on the newly accepted socket (faster
189 channel switching), default=1;
190
191 UDPXY_HTTP200_FTR_FILE
192 append contents of the given text file to the HTTP 200
193 response, default=none;
194
195 UDPXY_HTTP200_FTR_LN
196 append the text (line) to the HTTP 200 response, default=none;
197
198 UDPXY_ALLOW_PAUSES
199 if blocked on a write(2), keep reading data until the buffer
200 (-B <sizeK>) is full, default=disabled;
201
202 UDPXY_PAUSE_MSEC
203 allow only N milliseconds of reading data when blocked on a
204 write(2).
205
206 UDPXY_CONTENT_TYPE
207 specify custom Content-Type in HTTP responses.
208
209
211 Pavel V. Cherenkov and all the good people who submitted patches or
212 otherwise contributed to the project.
213
214
216 udpxrec(1)
217
218
219
220
221
222Version 1.0 November 17, 2012 udpxy(1)