Last active
March 17, 2025 18:53
GeForce Now 1440P on Linux Chrome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
from mitmproxy import http | |
url_pattern = re.compile(r"^.*\.nvidiagrid.net/v2/session") | |
user_agent_pattern = re.compile(r"(Mozilla\/[\d\.]+) \(.+?\)") | |
def request(flow: http.HTTPFlow) -> None: | |
# Check if the request matches the regex pattern | |
if url_pattern.match(flow.request.pretty_url): | |
flow.request.headers['nv-device-os'] = 'WINDOWS' | |
flow.request.headers['sec-ch-ua-platform'] = '"WINDOWS"' | |
flow.request.headers['sec-ch-ua-platform-version'] = '14.0.0' | |
if "user-agent" in flow.request.headers: | |
flow.request.headers["user-agent"] = user_agent_pattern.sub( | |
r'\1 (Windows NT 10.0; Win64; x64)', | |
flow.request.headers["user-agent"]) | |
if flow.request.headers.get("content-type") == "application/json": | |
try: | |
body = json.loads(flow.request.content) | |
if body.get("sessionRequestData", {}).get("clientRequestMonitorSettings", None) is not None: | |
body["sessionRequestData"]["clientRequestMonitorSettings"] = [ | |
{ | |
"heightInPixels": 1440, | |
"framesPerSecond": 120, | |
"widthInPixels": 2560 | |
} | |
] | |
flow.request.content = json.dumps(body).encode("utf-8") | |
except json.JSONDecodeError: | |
pass | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
var proxy = "PROXY <your proxy server IP>:<your proxy server port>"; | |
if (/^https:\/\/.+\.nvidiagrid.net/.test(url)) { | |
// Should only proxy /v2/session, but the URL path is removed by Chrome | |
return proxy; | |
} | |
return "DIRECT"; | |
} |
For those wondering what to do with this stuff to get it working:
- Install
mitmproxy
per the docs at: https://docs.mitmproxy.org/stable/overview-installation/ - Run mitmproxy and use the py file above as a script, passed to mitmproxy using the
-s
argument, so something like:
mitmproxy -s geforce-now-resolution-interceptor.py
- Then, you need to set up the pac-script.js in your browser of choice. Edge is probably a good option here, as it's supported by Geforce Now. I used an addon call "Proxy Switcher and Manager" and it allows you to enter an inline PAC file, and just use the content of the pac-script.js for that.
- One issue you'll run into is TLS not working correctly because you need to install a trusted CA cert from mitmproxy.org. Download the cert and follow the instructions for your OS. Restart mitmproxy and your browser.
- Enjoy the higher resolutions in GFN
I'm adding my 2 cents here are as the info I found here required a lot of digging and installing proxy extensions that are trying to do things Chrome does on it's on perfectly fine. My reply is also buried in that thread:
If you run mitmproxy, it defaults to 127.0.0.1
and 8080
(mitmproxy --help
).
The instructions provided here are not the clear on what has to be accomplished. So you need to break it down.
- Configure
mitmproxy
to ensure you have TLS support.- Copy the resolution interceptor script and start
mitmproxy
with it:mitmproxy -s /path/to/geforce-now-resolution-interceptor.py
. Keep that console open, you want to see the traffic intercepted there to know that everything is proxied. - Make sure you start a completely new instance of chrome, if you see Opening in existing browser session., you already have a chrome opened and it won't take into consideration --proxy-server.
- Try to reach
http://mitm.it
again. It should show the TLS certificates instructions. Install the certificate and configure chrome to "Identify Websites": "Settings -> Privacy and security -> Security -> Manage certificates -> Authorities -> Import". - Once the certificate is allowed to "Identify Websites", check that
https://mitm.it
is loading without warning. - If you are here and it's working, you don't need
--proxy-server
or any other extensions to manage the proxy, you can continue with CLI flags as longs are you start a fresh chrome instance.
- Copy the resolution interceptor script and start
- Configure Chrome to use the pac script
- Copy the pac script and note the path
- Update the
pac-script.js
script with your proxy address (default: 127.0.0.1:8080) - Start
mitmproxy
if you haven't - Start chrome with the
--proxy-pac-url
flag. YOU CANNOT PASS A FILEPATH DIRECTLY:google-chrome-stable --proxy-pac-url='data:application/x-javascript-config;base64,'$(base64 -w0 /path/to/pac-script.js)
- When going to the GNF game webpage, you should start seeing traffic in the
mitmproxy
console.
That did the trick for me. Got some 1440p gaming.
I dont see option to accept certificate.
EDIT:
Does it still work properly for you? I was able to accept the certificate but the resolution maxed out at 1920x1080
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi there @a9udn9u - can you show the output of the USER-AGENT, can you show the full headers and body you are sending? I think there's more to those entries.