mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
Add setting to bypass region restriction
This commit is contained in:
@@ -12,7 +12,17 @@ import { getPreferredServerRegion } from "./region";
|
||||
export
|
||||
class XcloudInterceptor {
|
||||
static async #handleLogin(request: RequestInfo | URL, init?: RequestInit) {
|
||||
if (getPref(PrefKey.SERVER_BYPASS_RESTRICTION)) {
|
||||
(request as Request).headers.set('X-Forwarded-For', '9.9.9.9');
|
||||
}
|
||||
|
||||
const response = await NATIVE_FETCH(request, init);
|
||||
if (response.status !== 200) {
|
||||
// Unsupported region
|
||||
BxEvent.dispatch(window, BxEvent.XCLOUD_SERVERS_UNAVAILABLE);
|
||||
return response;
|
||||
}
|
||||
|
||||
const obj = await response.clone().json();
|
||||
|
||||
// Preload Remote Play
|
||||
|
Reference in New Issue
Block a user