Skip to content

Commit e64e98f

Browse files
committed
Additional notes on mediamtx post
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 34b8b0b commit e64e98f

1 file changed

Lines changed: 57 additions & 2 deletions

File tree

docs/uplink/tutorials/high-throughput-tunnels.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ done
157157

158158
You should see `h264` three times.
159159

160-
## Connect one client
160+
## Connect the tunnel client
161161

162162
Get the tunnel token:
163163

@@ -166,7 +166,32 @@ inlets-pro tunnel token $TUNNEL \
166166
--namespace $NS > token.txt
167167
```
168168

169-
Run one inlets-pro client with three TCP upstreams:
169+
You can also use the tunnel plugin to print the client command:
170+
171+
```bash
172+
inlets-pro tunnel connect $TUNNEL \
173+
--namespace $NS \
174+
--domain $DOMAIN \
175+
--upstream 8551=127.0.0.1:8551 \
176+
--upstream 8552=127.0.0.1:8552 \
177+
--upstream 8553=127.0.0.1:8553 \
178+
--quiet
179+
```
180+
181+
It prints the `inlets-pro uplink client` command for the tunnel:
182+
183+
```bash
184+
inlets-pro uplink client \
185+
--url=wss://uplink.example.com/streams/mediamtx \
186+
--token=<redacted> \
187+
--upstream=8551=127.0.0.1:8551 \
188+
--upstream=8552=127.0.0.1:8552 \
189+
--upstream=8553=127.0.0.1:8553
190+
```
191+
192+
Run one inlets-pro client with three TCP upstreams. Add `--demux` for this
193+
RTSP use-case. It is optional, but highly recommended for multiple viewers or
194+
long-lived TCP connections over the same tunnel.
170195

171196
```bash
172197
inlets-pro uplink client \
@@ -181,6 +206,36 @@ inlets-pro uplink client \
181206
The left side of each `--upstream` is the tunnel port in Kubernetes. The right
182207
side is the private host address.
183208

209+
For a host service, the same plugin can generate a systemd unit:
210+
211+
```bash
212+
inlets-pro tunnel connect $TUNNEL \
213+
--namespace $NS \
214+
--domain $DOMAIN \
215+
--upstream 8551=127.0.0.1:8551 \
216+
--upstream 8552=127.0.0.1:8552 \
217+
--upstream 8553=127.0.0.1:8553 \
218+
--format systemd > $TUNNEL.service
219+
```
220+
221+
Add `--demux` to the generated `ExecStart` line before installing the unit.
222+
223+
If the private MediaMTX service is running inside Kubernetes or K3s, generate a
224+
client Deployment instead:
225+
226+
```bash
227+
inlets-pro tunnel connect $TUNNEL \
228+
--namespace $NS \
229+
--domain $DOMAIN \
230+
--upstream 8551=mediamtx.default.svc.cluster.local:8551 \
231+
--upstream 8552=mediamtx.default.svc.cluster.local:8552 \
232+
--upstream 8553=mediamtx.default.svc.cluster.local:8553 \
233+
--format k8s_yaml \
234+
--inlets-version 0.11.11 > $TUNNEL-client.yaml
235+
```
236+
237+
Add `--demux` to the generated client args, then apply the file.
238+
184239
## Test from the cluster
185240

186241
Create a temporary probe pod:

0 commit comments

Comments
 (0)