mirror of
https://github.com/games-on-whales/wolf.git
synced 2026-10-15 13:02:03 +00:00
[PR #441] fix: serialize the RTSP handshake per client IP (same-NAT clients) #469
Labels
No labels
🧠 1 - 🤖 999
AMD
bug
bug
cannot reproduce
documentation
duplicate
easy
enhancement
enhancement
enhancement
fixed?
fixed?
good first issue
hard
help wanted
Intel
invalid
LXC
medium
moonlight-protocol
Multi GPU
nixos
not a bug
nvidia
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/wolf#469
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/wolf/pull/441
Author: @kmreisi
Created: 6/22/2026
Status: 🔄 Open
Base:
beta← Head:fix/multi-port-rtsp-udp📝 Commits (1)
91c55f8fix: serialize the RTSP handshake per client IP📊 Changes
3 files changed (+161 additions, -3 deletions)
View changed files
📝
src/moonlight-server/rest/endpoints.hpp(+9 -0)📝
src/moonlight-server/rtsp/net.hpp(+40 -3)➕
src/moonlight-server/rtsp/rtsp_handshake.hpp(+112 -0)📄 Description
Wolf gives each session a random fake IP in the launch response and expects the client to echo it back as the RTSP
Host/URI — that's how it tells concurrent sessions apart. But below the high-quality-audio thresholdmoonlight-common-csendsHost: 0.0.0.0and drops it, and there is no other per-session identifier in the RTSP handshake (theSessionheader is a constant). So two clients behind the same NAT both arrive as0.0.0.0from the same source IP, Wolf routes both to the first session, and their AES keys and ENET secrets get swapped — video corrupts and one client's input lands in the other's session.Since the client can't reliably tell us which session it is, this couples each HTTPS launch/resume with the RTSP handshake that follows it: the launching client owns an exclusive RTSP window for its source IP, held until the handshake finishes (RTSP
PLAY). While the window is open, ambiguous0.0.0.0packets from that IP resolve to that session; a concurrent same-IP launch waits until the window closes, so two handshakes never overlap.A second distinct client on the same NAT that launches mid-handshake blocks at its own
/launchuntil the first window closes, so the two handshakes are serialized and never resolve to each other.Clients that do echo the fake IP (above the threshold) are still matched directly by it — the window only covers the
0.0.0.0case.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.