hmlendea / gfn-electron

Linux Desktop client for Nvidia's GeForce NOW game streaming service
GNU General Public License v3.0
538 stars 63 forks source link

[FEATURE] Implement specification spoof script for higher resolution and refresh rates #254

Open HerrTiSo opened 2 months ago

HerrTiSo commented 2 months ago

According to @a9udn9u, there exists a workaround to intercept the browser's spec request via proxy before it's sent to GFN, to go for 1440P@120Hz instead.

https://gist.github.com/a9udn9u/85e0c8e863db85c5b62320766bd7b2e9#file-geforce-now-resolution-interceptor-py

Would love to hear if we could make this work in the Electron app.

a9udn9u commented 2 months ago

Not an Electron expert, but if it can work around Google's upcoming restriction on the webRequest blocking API, the request can be modified without a proxy server.

SquiffyMcwhithers commented 1 month ago

Made an account just to comment how much I would love to see this feature added in.

HerrTiSo commented 1 month ago

push @hmlendea

lordgreg commented 6 days ago

Hi. I am just testing this with Requestly. So far, without the success.

Rule 1 - Body update:

function modifyRequestBody(args) {
  const { method, url, body, bodyAsJson } = args;
  let newBody;
  newBody = bodyAsJson;

  try {
    console.log(">>>", newBody)
    let settings = newBody.sessionRequestData;
    // settings.clientIdentification = "GFN-PC";
    // settings.clientVersion = 29.0;
    // settings.sdkVersion = 2.0;
    // settings.streamerVersion = "14";
    // settings.clientPlatformName = "Windows";

    let monitorsettings = settings.clientRequestMonitorSettings[0]; 
    // monitorsettings.widthInPixels = 3440; 
    // monitorsettings.heightInPixels = 1440; 
    monitorsettings.widthInPixels = 2560; 
    monitorsettings.heightInPixels = 1440;
    monitorsettings.framesPerSecond = 120;
    console.log("Updating", settings)
  } catch (e) {
    console.log("Monitor data not found", newBody)
  }
  return newBody;
}

Rule 2 - Headers update

image

The result is still 60 FPS and max 1920x1200.

image

My monitor resolution is 3440 x 1440. And, I've checked the Windows Browser version - you are limited to to the exact same resolution. @a9udn9u - am I missing something?

Can you post your Body and Headers output that is being sent to server?

Here is the POST Request being sent from NATIVE Windows Client:

HEADERS

POST https://********************.cloudmatchbeta.nvidiagrid.net/v2/session?keyboardLayout=en-US&languageCode=en_US HTTP/1.1
Connection: Keep-Alive
Content-Type: text/plain
Authorization: GFNJWT ********************
User-Agent: GFN-PC/29.0 (Windows 10.0.22621) BifrostClientSDK/4.71 (35125156)
NV-Client-ID: ********************
NV-Client-Streamer: NVIDIA-CLASSIC
NV-Client-Type: NATIVE
NV-Client-Version: 2.0.68.154
NV-Device-Make: To Be Filled By O.E.M.
NV-Device-Model: To Be Filled By O.E.M.
NV-Device-OS: WINDOWS
NV-Device-Type: DESKTOP
X-Device-Id: ********************
x-nv-client-identity: GFN-PC/29.0 (Windows 10.0.22621) BifrostClientSDK/4.71 (35125156)
traceparent: ********************
Content-Length: 1897
Host: ********************cloudmatchbeta.nvidiagrid.net
Cookie: SERVERID=********************

BODY

{
  "sessionRequestData": {
    "audioMode": 2,
    "clientDisplayHdrCapabilities": null,
    "remoteControllersBitmap": 0,
    "sdrHdrMode": 0,
    "enhancedStreamMode": 0,
    "metaData": [
      {
        "key": "ClientImeSupport",
        "value": "0"
      },
      {
        "key": "SubSessionId",
        "value": "b481232b-6c24-4f4f-aeea-a5244dc83189"
      },
      {
        "key": "clientPhysicalResolution",
        "value": "{\"horizontalPixels\":3440,\"verticalPixels\":1440}"
      },
      {
        "key": "latency@********************.cloudmatchbeta.nvidiagrid.net",
        "value": "19"
      },
      {
        "key": "latency@********************.cloudmatchbeta.nvidiagrid.net",
        "value": "37"
      },
      {
        "key": "latency@********************.cloudmatchbeta.nvidiagrid.net",
        "value": "27"
      },
      {
        "key": "latency@********************.cloudmatchbeta.nvidiagrid.net",
        "value": "29"
      },
      {
        "key": "latency@********************.cloudmatchbeta.nvidiagrid.net",
        "value": "34"
      },
      {
        "key": "networkType",
        "value": "Ethernet"
      },
      {
        "key": "wssignaling",
        "value": "1"
      },
      {
        "key": "surroundAudioInfo",
        "value": "2"
      }
    ],
    "clientVersion": "29.0",
    "partnerCustomData": null,
    "deviceHashId": "********************",
    "userAge": ********************,
    "internalTitle": null,
    "clientPlatformName": "Windows",
    "requestedStreamingFeatures": {
      "enabledL4S": false,
      "reflex": false,
      "bitDepth": 1,
      "mouseMovementFlags": 0,
      "cloudGsync": false
    },
    "surroundAudioInfo": 0,
    "enablePersistingInGameSettings": true,
    "clientTimezoneOffset": ********************,
    "preferredController": 2,
    "clientIdentification": "GFN-PC",
    "parentSessionId": null,
    "appId": ********************,,
    "streamerVersion": "14",
    "clientRequestMonitorSettings": [
      {
        "monitorId": 0,
        "positionX": 0,
        "positionY": 0,
        "heightInPixels": 1440,
        "sdrHdrMode": 0,
        "displayData": null,
        "framesPerSecond": 120,
        "hdr10PlusGamingData": null,
        "dpi": 0,
        "widthInPixels": 3440
      }
    ],
    "availableSupportedControllers": [
      2
    ],
    "appLaunchMode": 1,
    "sdkVersion": "2.0",
    "networkTestSessionId": null,
    "useOps": true,
    "secureRTSPSupported": true,
    "accountLinked": false,
    "requestedAudioFormat": 0
  }
}