How to make your own proxy

Hello guys, in this tutorial i will show you how to make your own proxy for roblox. With this proxy you will be able to access roblox.com resources without using different proxies like roproxy. Let’s start without further ado.

Firstly we will create a google apps script, this will be the server for our proxy.

Go to your google drive and click “New” on the top left corner

image

Click More > Google Apps Script

A menu like this should be opened:

Now we will write our code

// Define the doGet function, which handles incoming HTTP GET requests.

function doGet(e) {
  var output; // Declare a variable to store the response data.

  try {
    // Retrieve the "q" query parameter from the request URL.
    var query = e.parameter["q"];
    
    // Make an HTTP GET request to the URL specified in the "q" parameter.
    var response = UrlFetchApp.fetch(decodeURIComponent(query));
    
    // Create a success response with "result" set to "success" and "response" containing the fetched JSON data.
    output = {"result": "success", "response": JSON.parse(response.getContentText())};
  }
  catch(e) {
    // Handle any exceptions (errors) that occurred during the try block.
    
    // Create an error response with "result" set to "error" and an "error" message.
    output = {"result": "error", "error": "Unable to fetch"};
  }
  
  // Create a JSON response from the output object and set the MIME type to JSON.
  return ContentService.createTextOutput(JSON.stringify(output)).setMimeType(ContentService.MimeType.JSON);
}

This code will handle all of the “GET” requests to the server and return the data. More information is written as comments in the code.

Now, our google apps script code is done. Save the script and click deploy on the top right

And then click new deployment, select web app type, execute as me, and allow access to everyone

And then click deploy, when the deployment is finished, copy the URL.
Now your proxy is running, we need to make the script in roblox studio.

Open up a place in roblox studio and create a module script in serverstorage. And write these

local http = {}
local HttpService = game:GetService("HttpService")

function http.getasync(targetURL)
	local proxyURL = "YOUR PROXY URL THAT YOU HAVE COPIED"

	local query = "?q=" .. HttpService:UrlEncode(targetURL)
	local response = HttpService:GetAsync(proxyURL .. query)
	local decodedResponse = HttpService:JSONDecode(response)

	if decodedResponse.result == "success" then
		return response
	else
		return "Error fetching data:", decodedResponse.error
	end
end

return http

This code will use the proxy to get and return the appropriate data.
How to use the module:

Create a new script in serverscriptservice and type these:

local http = require(game.ServerStorage.HTTP)

print(http.getasync("https://users.roblox.com/v1/users/424762688"))

Warning: Don’t forget to enable http requests for your game. Type this in the console to activate http service

game.HttpService.HttpEnabled = true

This script will use our proxy to get data from roblox website and print it out to the console, and now everything is ready! You can start using your proxy now and get the coolest data on roblox :sunglasses:

30 Likes

I remember there’s a 7 year old topic for this

but I still appreciate it as It can have more details

3 Likes

really helpful cheers mate! keep it up!

2 Likes

Roblox recently allowed http service requests for roblox.com

2 Likes

Roblox didn’t give access to every api on roblox.com, they only gave access to some urls. For example when i try to make a request to this url “https://users.roblox.com/v1/users/424762688

I get an error saying that “HttpService is not allowed to access that ROBLOX resource”

image

4 Likes

It said “specific roblox domains” anyways

2 Likes

Only specific domains will be accessible! Also this isn’t live yet.

1 Like

How would I make a POST request with this?!

function doPost(e) {
  var output;
  try {
    var query = e.parameter["q"];
    var response = UrlFetchApp.fetch(decodeURIComponent(query));
    output = {"result": "success", "response": JSON.parse(response.getContentText())};
  }
  catch(e) {
    output = {"result": "error", "error": "Unable to fetch"};
  }
  return ContentService.createTextOutput(JSON.stringify(output)).setMimeType(ContentService.MimeType.JSON);
}

I have bad knowledge on javascript so sorry if I used incorrect methods

2 Likes