Replies: 2 comments
-
|
I've chipped away at this a little more, and believe I have a functional implementation. Screencast.From.2026-01-14.12-22-17.mp4 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Opened a PR here if the modifications are acceptable: #489 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have found myself in need of some state tracking regarding root ports.
For my use case, I was running a systemd unit with a reflector and updating the reflector clients by terminating,regenerating the systemd unit with a new command line and restarting the reflector process whenever the system needed to add or remove a client from the video stream. The issue with this approach is that it caused a disruption to the video streaming to existing clients every time I needed to dynamically add and remove a client.
So, I was quite happy when I found the control port API existed, and I could use this to dynamically add clients without having to restart the reflector process. So far so good.
The issue I subsequently ran into, is that it's hard to tell which client IP/hostname relates to the root port. Either it requires a wrapper with some kind of external state tracking, or I needed a way to interrogate the API to see what currently exists.
I've generated a fork of UG and attempted to add such functionality by modifying hd_rum_translator.cpp and control_socket.cpp.
This enables a "list-ports" or "query-ports" command which can be submitted via nc
echo "list-ports" | nc 127.0.0.1 6161This intermittently provides an output of the currently subscribed reflector clients, and in the stdout in the terminal/journald output:
200 OK Root ports: [0] 192.168.108.31:5004 (192.168.108.31:5004) - forwarding [1] 192.168.108.33:5004 (192.168.108.33:5004) - forwarding [2] 192.168.108.34:5004 (192.168.108.34:5004) - forwarding [3] 192.168.108.35:5004 (192.168.108.35:5004) - forwardingI suspect the repeat message suppression in debug.h is why it will only output the ports list after an addition/removal.
Commit here:
armelvil@42a6fcb
Another thing I am noticing is that it's possible to add the same IP/client multiple times, and it's possible to effectively DDoS target clients by adding multiple entries. To remedy this, I've tried adding a check for an existing client/port which should output:
Output port 192.168.108.35:5004 already exists.Commit here:
armelvil@ec37ad6
disclosure; because this isn't really my wheelhouse, I've been leaning on LLM's to assist me in understanding the codebase, apologies in advance for the things I have undoubtedly missed and/or failed to take into account.
Beta Was this translation helpful? Give feedback.
All reactions