A Question about HttpService & Proxies

Objective:

  1. I’m trying to make a button to send group funds from within the game.
    image

Introduction:

  1. I’m very new to Http Service and Proxies, but from what I’ve read I should run the proxy locally
    for security reasons. I think I was able to run the proxy on my computer successfully using rprxy

    image

Question:

  1. I’m just unsure how to use this at all, I’m just asking for help, Are there any resources you could recommend that are beginner-friendly, or Discord servers that would be able to help me?

I will be very appreciative of any relevant info that will help me out.
Thank you!

1 Like

You should get a cloud server to host the proxy.

Do you know of any free cloud services?

You can try Google Cloud Platform, Microsoft Azure or Amazon Web Services. However, the free tier has a limit. Once you use up your free credits, you will be charged for the remaining. You also will have to give your billing information upon sign up.

You can self host your proxy on your own pc which is what I’m doing currently for one of my game. However, in my case, my game doesn’t rely on a proxy being available 24/7, so I still leave my pc turned off for multiple hours

If you need your proxy to run 24/7, then a cloud service can be a good option. You’ll avoid downtime from your power going out, or stuff like that

If you self host a proxy, you have to do port forwarding, and get a domain/subdomain (I use freedns for my proxy, it’s free for subdomains and works great). Roblox’s http service strait up refuses to send requests to direct ip addresses, and depending on your internet provider, your ip address could change from time to time (which happens with mine). Freedns has an api for updating the ip address your subdomain points to. I assume you haven’t done that with your local version of rprxy?

I’ve made my own proxy from scratch using lune (aka my proxy is written in luau). My proxy doesn’t just reroute api calls to the roblox api, like other roblox proxies. It isn’t that hard to make, just make sure that bad actors can’t use it to compromise your machine. If you have any questions, I can very likely answer them

I’d probably have to use a cloud service for my game, but how would I do that for things that need cookies? Like sending group payouts through a script.

I don’t know, I’ve never played with cookies, but you can read about it here

The server can ask the browser (or your program) to store a cookie using the set-cookie header, clients (browsers or your program) can send a cookie using the cookie header of the http request

Okay for example. How would I make a simple script that checks my inventory using my Google-hosted cloud proxy? Also, how do I even set it up? Sorry for asking so many questions I haven’t been able to find an answer anywhere else.

I’m sorry, I can’t answer those questions. I would recommend first looking up what the api for the inventory api is. (I’ve also read in the latest api deprecation announcement that newer apis have auth 2.0, and idk if you can still use cookies with them)

I would recommend looking up documentation pages about cookies/auth 2.0 (perhaps auth 2.0 is easier?), or tutorials, that aren’t specific to your problem (as finding something specific to what you are doing will be very hard). Chat Gpt or some other ai can also be very useful for these kinds of questions

You can use any coding language on your google proxy (is it just a proxy, or a server on which you can basically do whatever? A proxy is a “server” that redirects your requests). If you chose lune, to write it in luau, be ware that there are basically no tutorials about lune, and ai’s don’t know what it is either. If you go with like python, python has a lot of libraries and resources online

Here is my lune script for retreiving logs from a datastore in my game using open cloud, if that helps

local net = require("@lune/net")

local writeFile = require("../Utils/writefile")
local Data = require("../Utils/Data")

local Key = "Not leaking my key today :P"

local OpenCloud = {}

function OpenCloud:RetreiveStoredLogs()

   local Result, Error = net.request({
      url = "https://apis.roblox.com/cloud/v2/universes/5260885184/data-stores/ProxyLogs/entries/Logs",
      method = "GET",
      headers = { ["x-api-key"] = Key},
   })

	if not Result then error(Error) end
	local Body = net.jsonDecode(Result.body)

	if Body.errors then error(Body.errors[1].message) end
	if not Result.ok then error(Result.statusCode .. " " .. Result.statusMessage) end -- Fallback error handling
   
   local Values = Body.value
   local FirstValueIndex = Values[1]
   table.remove(Values, 1)
   
   local PreviousReadIndex = Data:Get("ReadIndex") or 0
   Data:Set("ReadIndex", (FirstValueIndex -1) + #Values)

   local ReadStart = (PreviousReadIndex + 1) - (FirstValueIndex - 1)

   local SuccessMessage = "Stored logs retreived successfully"

   if ReadStart < 1 then 
      SuccessMessage = (math.abs(ReadStart) + 1).." values are missing from the stored logs, but other logs were retreived successfully"
      writeFile("Info", "Logs Errors", (math.abs(ReadStart) + 1).." values are missing from the stored logs. They were deleted before they could be read")
   end

   for i = math.max(1,ReadStart), #Values do 
      local Log = net.jsonDecode(Values[i])

      pcall(function() 
         writeFile(Log[1], Log[2], Log[3], Log[4])
      end)
   end

   return {SuccessMessage, net.jsonEncode(table.move(Values, math.max(1,ReadStart), #Values, 1, {}))}
end

return OpenCloud

The Data module is to save some data to a local file on my pc, for data I need between each time I start and stop my server. writefile is to write files lol

Here is my main server file
Main.luau (7.5 KB)

Couldn’t send it as text directly

You can maybe use this as a reference, idk