unknownskl / greenlight

Greenlight is an open-source client for xCloud and Xbox home streaming made in Typescript.
MIT License
2.27k stars 123 forks source link

Network traffic #884

Open Neckk opened 1 year ago

Neckk commented 1 year ago

Not exactly a project issue.

I use Greenlight on MacOS and I try to sniff the network communication with Charles proxy. I wanted to compare it to the Xbox app on iOS. Proxy configuration is done and works well systemwide, even with the SSL traffic.

My issue is, that I can't see anything besides the requests happening in the web view. I can't see device authentication, sisu authentication or gssv-play-prod requests. I know that they are made, because after starting the binary from terminal, I see some debug info popping in the output.

It's the first time I encounter such issue. I'm not a node, or rust developer, but I tried going through the code to find some answers and I can't see any. It looks like the app makes regular https requests. I'm very puzzled why does it behave like that.

Do you have any idea why isn't the traffic showing in the proxy? Maybe some pointers on how to make it show?

unknownskl commented 1 year ago

The app doesn't use http for the stream. You would need something like Wireshark to capture the traffic. If you are curious about the implementation of WebRTC (which is used for the stream) then you might want to check out this package: https://github.com/unknownskl/xbox-xcloud-player

Neckk commented 1 year ago

I understand that the gameplay itself happens with webrtc and sniffing that, would be a lot more challenging. I meant the authentication part (before starting the gaming session). My understanding is, that it happens with usage of functions in https://github.com/unknownskl/xal-node. ex. I can't see the request made by this function: https://github.com/unknownskl/xal-node/blob/11ff8f22faf483df715ca9ade1b6f7fc1f695291/src_ts/xalauthenticator.ts#L56 even though I see a relevant response in the console (when starting the binary from terminal). The proxy should be configured properly, as I can see the request to "https://login.live.com/oauth20_authorize.srf" which happens in the webview.