From 2ca3d0733e7fb3ab09993a57e57aabfc45840d38 Mon Sep 17 00:00:00 2001 From: FusionNetworksAU Date: Tue, 31 Mar 2026 09:04:46 +0800 Subject: [PATCH] fix(client): NUI upload/stream via resource https URLs (DDoS/WAF safe path) Fixes uploads breaking when the server is behind VibeGames style DDoS protection: NUI no longer POSTs to http://GetCurrentServerEndpoint/..., it uses https:///upload and /stream instead. --- game/client/bootstrap.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/game/client/bootstrap.ts b/game/client/bootstrap.ts index 1b0b465..3c7b8b2 100644 --- a/game/client/bootstrap.ts +++ b/game/client/bootstrap.ts @@ -1,4 +1,3 @@ -import { request } from 'http'; import { netEventController } from './event'; import { CaptureRequest, RequestScreenshotUploadCB, ScreenshotCreatedBody } from './types'; import { exportHandler, uuidv4 } from './utils'; @@ -15,7 +14,7 @@ onNet('screencapture:captureScreen', (token: string, options: object, dataType: uploadToken: token, dataType, action: 'capture', - serverEndpoint: `http://${GetCurrentServerEndpoint()}/${GetCurrentResourceName()}/upload`, + serverEndpoint: `https://${GetCurrentResourceName()}/upload`, }); }); @@ -139,7 +138,7 @@ function createImageCaptureMessage(options: CaptureRequest) { SendNUIMessage({ ...options, action: 'capture', - serverEndpoint: `http://${GetCurrentServerEndpoint()}/${GetCurrentResourceName()}/upload`, + serverEndpoint: `https://${GetCurrentResourceName()}/upload`, }); } @@ -148,7 +147,7 @@ onNet("screencapture:captureStream", (token: string, options: object) => { ...options, uploadToken: token, action: 'capture-stream-start', - serverEndpoint: `http://${GetCurrentServerEndpoint()}/${GetCurrentResourceName()}/stream`, + serverEndpoint: `https://${GetCurrentResourceName()}/stream`, }); })