moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
3.23k stars 512 forks source link

Any idea what could block Internet streaming on a network? #514

Closed Slayer418 closed 5 years ago

Slayer418 commented 6 years ago

I'm currently trying to start a streaming session over the internet from my office to my home PC. My setup has been in place for years and it definitely is working (just tested again on LTE) but on my office network, it doesn't work. My PC with all its games are showing, the pairing worked, but whenever I try to launch something I get "Failed to start RTSP".

Any idea what is happening here (Windows Firewall is disabled btw)?

EDIT: I don't know if teamviewer uses RTSP but it is working.

Slayer418 commented 6 years ago

I guess RTSP port is being blocked at some point on the network. Port 80 is open, would it be possible to change the port used by Moonlight for RTSP?

cgutman commented 6 years ago

This sounds like it's possibly an RTSP port forwarding issue related to GeForce Experience v3.12. Can you double check that you have TCP 48010 forwarded correctly (UDP 48010 was used by GFE v3.11 and earlier)?

Slayer418 commented 6 years ago

My 48010 has been set to both UPD and TCP since I forgot when. My stream is working perfectly on my mobile data so the issue isn't on my home side.

cgutman commented 6 years ago

That's pretty peculiar. I would expect that any network that allows TCP 47989 and TCP 47984 (required for detecting the PC is online and pairing) to also allow TCP 48010 used by RTSP.

Slayer418 commented 6 years ago

Hmm that's really weird indeed, could the proxy on the network be detecting whenever a port is used for RTSP stream and block it?

Edit: http://portquiz.net:48010 works on the network.

cgutman commented 6 years ago

If your company has a firewall, I guess it could inspect that traffic and discard it. You could try downgrading your PC to GFE v3.11 and see if that allows it to work again (since RTSP is done over UDP on that version).

Slayer418 commented 6 years ago

Why did they change for TCP, isn't UDP better for streaming?

cgutman commented 6 years ago

RTSP is only done in the beginning to negotiate the stream parameters, so it's not latency-sensitive. The video, audio, and input data is all over UDP.

Slayer418 commented 6 years ago

Oh I see, well thanks for replying. I guess i'm screwed. Feels bad being so close to the goal.

Slayer418 commented 6 years ago

I want to add that if I start the stream using mobile data and switch to Office WIFI without tabbing out of moonlight (without interupting the stream) the image freeze but it doesn't crash/disconnect.

Slayer418 commented 6 years ago

Back at it again, my issue is still not fixed and I went into some tracing with Wireshark. UDP seems to not be blocked or atleast not for TeamViewer. I have found that no UDP packets is being traced by Wireshark when trying to use Moonlight. Would it be possible to use TeamViewer ports (since those would appear to be unfiltered) with Moonlight?

Edit: More tracing, I had forgotten to check TCP communication on port 48010 and it appears that wireshark see the packet sent by moonlight when trying to launch a game (which goes in launched state btw, so def communicating) but after that, my computer try to send back a packet to moonlight which lead to 2 TCP Retransmissions followed by a RST packet (TCP Reset) being sent meaning failure I guess. Hmm there gotta be a workaround.

Slayer418 commented 6 years ago

Found the name of what is blocking, WatchGuard HTTP Proxy which filter rtsp:// link. Now gotta find a solution. If I understand well, RTSP is not used for the actual data streaming (images,audio and input) would it be possible that moonlight uses a http link for the rtsp transmission, maybe the actual data streaming wouldn't be blocked based on TeamViewer working so all I need is to pass the RTSP communication.

Not sure if it would work but I'd need a modified moonlight where the performRtspHandshake() in RtspConnection.c would use a http link to port 48010.

Edit: Managed to hex edit the libcore file, replacing rtsp by http and it's still getting filtered :

v#wrap {
        margin-top: 50px;
      }
    </style>
  </head>
  <body> 
    <div id="wrap">
      <div class="band"></div>
      <div class="box" style="word-wrap:break-word;">
        <p class="red">Request denied by WatchGuard HTTP Proxy.</p>
        <p><b> Reason: </b> request-line invalid line='OPTIONS http://64.*.*.*:48010 RTSP/1.0\x0d\x0a' </p>
        <p>Please contact your administrator for assistance.</p>
        <p>More Details:</p>
        <p><b>Method:</b> </p>
        <p><b>Host:</b> 10.*.*.*:48010</p>
        <p><b>Path:</b> </p> 
      </div>
      <div class="band">WatchGuard Technologies, Inc.</div>
    </div>

</body>
</html>
Slayer418 commented 6 years ago

I want to add that if I start the stream using mobile data and switch to Office WIFI without tabbing out of moonlight (without interupting the stream) the image freeze but it doesn't crash/disconnect.

I found out that when I do this, Input is still working as I still control the mouse and keyboard but have no audio and video. Wireshark shows a continuous stream of UDP packets still being sent by NvStreamer to my mobile internet IP (Eventho I have switched to the WIFI connection). What I'd need is a way to inform NvStreamer that there is a new IP to use without interupting the stream and having to go throught another RTSP handshake or, in a perfect world, a way to skip the RTSP handshake, forcing the stream to use preset parameters or Idk.

I tried to debug NvStreamer in hope of being able to replace the old IP by the new one, without much success so far.

Got any idea @cgutman?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.